Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Release Plugin

on:
push:
branches:
- '**'

jobs:
build-artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Set up Gradle
uses: gradle/gradle-build-action@v3

- name: Extract plugin version
id: get_version
run: |
version=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2)
echo "PLUGIN_VERSION=$version" >> $GITHUB_ENV

- name: Build plugin
run: ./gradlew buildPlugin

- name: Rename plugin artifact
run: |
mv build/distributions/*.zip YALI_${{ env.PLUGIN_VERSION }}.zip

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: YALI_${{ env.PLUGIN_VERSION }}
path: YALI_${{ env.PLUGIN_VERSION }}.zip

release:
if: github.ref == 'refs/heads/master'
needs: build-artifact
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: YALI_${{ env.PLUGIN_VERSION }}

- name: Create Release and Upload Artifact
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.PLUGIN_VERSION }}
name: Release v${{ env.PLUGIN_VERSION }}
files: YALI_${{ env.PLUGIN_VERSION }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ out
meta
layouts
.idea
.vscode
### Java template
# Compiled class file
*.class
Expand Down Expand Up @@ -37,3 +38,5 @@ hs_err_pid*
/.kotlin
log.txt
android-layout-inspector-settings.json
# Исключить артефакты сборки плагина
YALI_*.zip
71 changes: 26 additions & 45 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ plugins {
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "2.1.0"
// Gradle IntelliJ Platform Plugin
// https://github.com/JetBrains/intellij-platform-gradle-plugin
id("org.jetbrains.intellij.platform") version "2.6.0"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "1.3.1"
// Protobuf support
id("com.google.protobuf") version "0.9.4"
// https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "2.2.1"
}

fun properties(key: String) = project.findProperty(key).toString()
Expand All @@ -21,28 +19,45 @@ version = properties("pluginVersion")
// Configure Java compatibility
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

// Configure project's dependencies
repositories {
mavenCentral()
google()
intellijPlatform { defaultRepositories() }
}

intellijPlatform {
pluginConfiguration {
name = properties("pluginName")
group = properties("pluginGroup")
changeNotes.set("Updated android studio compatibility to 2024.3.1.7")
ideaVersion.sinceBuild.set(project.property("sinceBuild").toString())
ideaVersion.untilBuild.set(provider { null })
}
buildSearchableOptions.set(false)
instrumentCode = true
}

dependencies {
intellijPlatform {
androidStudio(properties("platformVersion"))
bundledPlugin("org.jetbrains.android")
if (project.hasProperty("localASVersion")) {
local(property("localASVersion").toString())
} else {
androidStudio(property("platformVersion").toString())
}
}
implementation(platform("io.projectreactor:reactor-bom:2024.0.0"))
implementation("io.projectreactor.netty:reactor-netty-http:1.1.13")
Expand All @@ -57,41 +72,7 @@ dependencies {
testImplementation("junit:junit:4.12")
}

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.1"
}
generateProtoTasks {
all().forEach { task ->
task.builtins {
named("java") {
option("lite")
}
}
}
}
}

sourceSets {
main {
proto {
srcDir("proto")
}
}
}

tasks {
patchPluginXml {
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
untilBuild = properties("pluginUntilBuild")
changeNotes = """
Support Android Studio Ladybug.<br>
Improved tree renderer.<br>
Fixed uiautomator dump.<br>
"""
}

runIde {
jvmArgs = listOf(
"-Dide.mac.message.dialogs.as.sheets=false",
Expand All @@ -102,7 +83,7 @@ tasks {

withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
jvmTarget.set(JvmTarget.JVM_21)
}
}
}
12 changes: 8 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ kotlin.stdlib.default.dependency=false
platformPlugins=android
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType=AI
platformVersion=2025.1.1.2
#TODO: set to 2025.1.1.2
platformVersion=2024.3.1.7
pluginGroup=com.github.grishberg.android
pluginName=android-layout-inspector-plugin
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild=233
pluginUntilBuild=252.*
pluginVersion=25.05.29.0
#TODO: set to 252.*
sinceBuild=243.22562.145
pluginVersion=25.08.04.0
# Use the latest of Android plugin versionAdd commentMore actions
# see https://github.com/JetBrains/intellij-platform-gradle-plugin/releases
androidPluginVersion=243.22562.218
studioCompilePath=/Applications/Android Studio Preview.app/Contents
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ pluginManagement {
}
}

rootProject.name = 'android-layout-inspector-plugin'
rootProject.name = 'YALI'
Loading