Skip to content

Commit dd1650c

Browse files
committed
build: add build and release actions
1 parent d8c6cc2 commit dd1650c

6 files changed

Lines changed: 96 additions & 8 deletions

File tree

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ ij_kotlin_packages_to_use_import_on_demand = *
1616

1717
[*.bat]
1818
end_of_line = crlf
19+
20+
[*.yml]
21+
indent_style = space
22+
indent_size = 2

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main, build-test ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Set up JDK
16+
uses: actions/setup-java@v5
17+
with:
18+
distribution: temurin
19+
java-version: 25
20+
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v6
23+
24+
- name: Build
25+
run: ./gradlew clean build dist

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
# TODO: run on every commit and create release if list content changes
4+
5+
on:
6+
push:
7+
tags:
8+
- "v*"
9+
10+
# additional permissions for provided GitHub token to create new release
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- name: Set up JDK
21+
uses: actions/setup-java@v5
22+
with:
23+
distribution: temurin
24+
java-version: 25
25+
26+
- name: Set jadx version and release name
27+
uses: actions/github-script@v9
28+
with:
29+
script: |
30+
const listVersion = context.ref.split('/').pop()
31+
core.exportVariable('LIST_VERSION', listVersion);
32+
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@v6
35+
36+
- name: Build
37+
run: ./gradlew clean dist
38+
39+
40+
- name: Release
41+
uses: softprops/action-gh-release@v3
42+
with:
43+
name: ${{ env.LIST_VERSION }}
44+
draft: true
45+
generate_release_notes: true
46+
fail_on_unmatched_files: true
47+
files: build/dist/jadx-plugins-list.zip

builder/build.gradle.kts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,12 @@ dependencies {
2727
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0")
2828
implementation("com.google.code.gson:gson:2.13.2")
2929
implementation("io.github.oshai:kotlin-logging-jvm:8.0.01")
30-
implementation("ch.qos.logback:logback-classic:1.5.32")
3130

3231
implementation("io.github.skylot:jadx-plugins-tools:1.5.5")
3332

3433
implementation("io.github.skylot:jadx-gui:1.5.5")
3534
}
3635

37-
java {
38-
toolchain {
39-
languageVersion.set(JavaLanguageVersion.of(11))
40-
}
41-
}
42-
4336
application {
4437
mainClass.set("jadx.plugins.list.ListBuilderCliKt")
4538
}
@@ -50,6 +43,16 @@ kapt {
5043
}
5144
}
5245

46+
val dist by tasks.registering(JavaExec::class) {
47+
group = "dist"
48+
classpath = sourceSets.main.get().runtimeClasspath
49+
mainClass = "jadx.plugins.list.ListBuilderCliKt"
50+
val outZip = rootProject.layout.buildDirectory.file("dist/jadx-plugins-list.zip")
51+
setArgsString("-m DELTA -i ${rootDir.absolutePath}/list -o ${outZip.get().asFile.absolutePath}")
52+
// resole warning about multiple logback.xml files, set full path
53+
jvmArgs = listOf("-Dlogback.configurationFile=file:${project.projectDir.absolutePath}/src/main/resources/logback.xml")
54+
}
55+
5356
tasks.withType<DependencyUpdatesTask> {
5457
rejectVersionIf {
5558
isNonStable(candidate.version)

builder/src/main/kotlin/jadx/plugins/list/Bundle.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ class Bundle(
2121
ZipOutputStream(
2222
Files.newOutputStream(zip, WRITE, CREATE, TRUNCATE_EXISTING).buffered(),
2323
).use { out ->
24-
out.putNextEntry(ZipEntry("list.json"))
24+
val listEntry = ZipEntry("list.json")
25+
listEntry.time = 0L // fixed time to get same file content like in 'reproducible builds'
26+
out.putNextEntry(listEntry)
2527
out.write(content.toByteArray())
28+
out.closeEntry()
2629
}
2730
}
2831

0 commit comments

Comments
 (0)