Skip to content

Commit 24b6963

Browse files
Merge pull request #53 from Grigory-Rylov/github_actions_releases
GitHub actions releases
2 parents 2735509 + cdaa151 commit 24b6963

7 files changed

Lines changed: 101 additions & 52 deletions

File tree

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and Release Plugin
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build-artifact:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'temurin'
19+
java-version: '21'
20+
21+
- name: Set up Gradle
22+
uses: gradle/gradle-build-action@v3
23+
24+
- name: Extract plugin version
25+
id: get_version
26+
run: |
27+
version=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2)
28+
echo "PLUGIN_VERSION=$version" >> $GITHUB_ENV
29+
30+
- name: Build plugin
31+
run: ./gradlew buildPlugin
32+
33+
- name: Rename plugin artifact
34+
run: |
35+
mv build/distributions/*.zip YALI_${{ env.PLUGIN_VERSION }}.zip
36+
37+
- name: Upload artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: YALI_${{ env.PLUGIN_VERSION }}
41+
path: YALI_${{ env.PLUGIN_VERSION }}.zip
42+
43+
release:
44+
if: github.ref == 'refs/heads/master'
45+
needs: build-artifact
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Download artifact
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: YALI_${{ env.PLUGIN_VERSION }}
52+
53+
- name: Create Release and Upload Artifact
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
tag_name: v${{ env.PLUGIN_VERSION }}
57+
name: Release v${{ env.PLUGIN_VERSION }}
58+
files: YALI_${{ env.PLUGIN_VERSION }}.zip
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ out
77
meta
88
layouts
99
.idea
10+
.vscode
1011
### Java template
1112
# Compiled class file
1213
*.class
@@ -37,3 +38,5 @@ hs_err_pid*
3738
/.kotlin
3839
log.txt
3940
android-layout-inspector-settings.json
41+
# Исключить артефакты сборки плагина
42+
YALI_*.zip

build.gradle.kts

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ plugins {
55
id("java")
66
// Kotlin support
77
id("org.jetbrains.kotlin.jvm") version "2.1.0"
8-
// Gradle IntelliJ Platform Plugin
8+
// https://github.com/JetBrains/intellij-platform-gradle-plugin
99
id("org.jetbrains.intellij.platform") version "2.6.0"
10-
// Gradle Changelog Plugin
11-
id("org.jetbrains.changelog") version "1.3.1"
12-
// Protobuf support
13-
id("com.google.protobuf") version "0.9.4"
10+
// https://github.com/JetBrains/gradle-changelog-plugin
11+
id("org.jetbrains.changelog") version "2.2.1"
1412
}
1513

1614
fun properties(key: String) = project.findProperty(key).toString()
@@ -21,28 +19,45 @@ version = properties("pluginVersion")
2119
// Configure Java compatibility
2220
java {
2321
toolchain {
24-
languageVersion.set(JavaLanguageVersion.of(17))
22+
languageVersion.set(JavaLanguageVersion.of(21))
2523
}
26-
sourceCompatibility = JavaVersion.VERSION_17
27-
targetCompatibility = JavaVersion.VERSION_17
24+
sourceCompatibility = JavaVersion.VERSION_21
25+
targetCompatibility = JavaVersion.VERSION_21
2826
}
2927

3028
kotlin {
3129
jvmToolchain {
32-
languageVersion.set(JavaLanguageVersion.of(17))
30+
languageVersion.set(JavaLanguageVersion.of(21))
3331
}
3432
}
3533

3634
// Configure project's dependencies
3735
repositories {
3836
mavenCentral()
37+
google()
3938
intellijPlatform { defaultRepositories() }
4039
}
4140

41+
intellijPlatform {
42+
pluginConfiguration {
43+
name = properties("pluginName")
44+
group = properties("pluginGroup")
45+
changeNotes.set("Updated android studio compatibility to 2024.3.1.7")
46+
ideaVersion.sinceBuild.set(project.property("sinceBuild").toString())
47+
ideaVersion.untilBuild.set(provider { null })
48+
}
49+
buildSearchableOptions.set(false)
50+
instrumentCode = true
51+
}
52+
4253
dependencies {
4354
intellijPlatform {
44-
androidStudio(properties("platformVersion"))
4555
bundledPlugin("org.jetbrains.android")
56+
if (project.hasProperty("localASVersion")) {
57+
local(property("localASVersion").toString())
58+
} else {
59+
androidStudio(property("platformVersion").toString())
60+
}
4661
}
4762
implementation(platform("io.projectreactor:reactor-bom:2024.0.0"))
4863
implementation("io.projectreactor.netty:reactor-netty-http:1.1.13")
@@ -57,41 +72,7 @@ dependencies {
5772
testImplementation("junit:junit:4.12")
5873
}
5974

60-
protobuf {
61-
protoc {
62-
artifact = "com.google.protobuf:protoc:3.25.1"
63-
}
64-
generateProtoTasks {
65-
all().forEach { task ->
66-
task.builtins {
67-
named("java") {
68-
option("lite")
69-
}
70-
}
71-
}
72-
}
73-
}
74-
75-
sourceSets {
76-
main {
77-
proto {
78-
srcDir("proto")
79-
}
80-
}
81-
}
82-
8375
tasks {
84-
patchPluginXml {
85-
version = properties("pluginVersion")
86-
sinceBuild = properties("pluginSinceBuild")
87-
untilBuild = properties("pluginUntilBuild")
88-
changeNotes = """
89-
Support Android Studio Ladybug.<br>
90-
Improved tree renderer.<br>
91-
Fixed uiautomator dump.<br>
92-
"""
93-
}
94-
9576
runIde {
9677
jvmArgs = listOf(
9778
"-Dide.mac.message.dialogs.as.sheets=false",
@@ -102,7 +83,7 @@ tasks {
10283

10384
withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
10485
compilerOptions {
105-
jvmTarget.set(JvmTarget.JVM_17)
86+
jvmTarget.set(JvmTarget.JVM_21)
10687
}
10788
}
10889
}

gradle.properties

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ kotlin.stdlib.default.dependency=false
1212
platformPlugins=android
1313
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1414
platformType=AI
15-
platformVersion=2025.1.1.2
15+
#TODO: set to 2025.1.1.2
16+
platformVersion=2024.3.1.7
1617
pluginGroup=com.github.grishberg.android
1718
pluginName=android-layout-inspector-plugin
1819
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1920
# for insight into build numbers and IntelliJ Platform versions.
20-
pluginSinceBuild=233
21-
pluginUntilBuild=252.*
22-
pluginVersion=25.05.29.0
21+
#TODO: set to 252.*
22+
sinceBuild=243.22562.145
23+
pluginVersion=25.08.04.0
24+
# Use the latest of Android plugin versionAdd commentMore actions
25+
# see https://github.com/JetBrains/intellij-platform-gradle-plugin/releases
26+
androidPluginVersion=243.22562.218
2327
studioCompilePath=/Applications/Android Studio Preview.app/Contents

gradle/wrapper/gradle-wrapper.jar

2.84 KB
Binary file not shown.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
5-
zipStorePath=wrapper/dists
6+
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ pluginManagement {
66
}
77
}
88

9-
rootProject.name = 'android-layout-inspector-plugin'
9+
rootProject.name = 'YALI'

0 commit comments

Comments
 (0)