diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..71ff902
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -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 }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 3567598..b1436ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ out
meta
layouts
.idea
+.vscode
### Java template
# Compiled class file
*.class
@@ -37,3 +38,5 @@ hs_err_pid*
/.kotlin
log.txt
android-layout-inspector-settings.json
+# Исключить артефакты сборки плагина
+YALI_*.zip
diff --git a/build.gradle.kts b/build.gradle.kts
index f280874..2c7e09f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -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()
@@ -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")
@@ -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.
- Improved tree renderer.
- Fixed uiautomator dump.
- """
- }
-
runIde {
jvmArgs = listOf(
"-Dide.mac.message.dialogs.as.sheets=false",
@@ -102,7 +83,7 @@ tasks {
withType().configureEach {
compilerOptions {
- jvmTarget.set(JvmTarget.JVM_17)
+ jvmTarget.set(JvmTarget.JVM_21)
}
}
}
diff --git a/gradle.properties b/gradle.properties
index 9db016a..03eb271 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -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
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index f3d88b1..ccebba7 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e846b64..18362b7 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -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
\ No newline at end of file
+zipStorePath=wrapper/dists
diff --git a/settings.gradle b/settings.gradle
index f3cba8c..b12f33a 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -6,4 +6,4 @@ pluginManagement {
}
}
-rootProject.name = 'android-layout-inspector-plugin'
\ No newline at end of file
+rootProject.name = 'YALI'