Skip to content

Commit

Permalink
Add android.jar and core-lambda-stubs.jar to assets, and update t…
Browse files Browse the repository at this point in the history
…ree-sitter to v3.4.0

Tested-by: Pranav Purwar <[email protected]>
Signed-off-by: PranavPurwar <[email protected]>
  • Loading branch information
PranavPurwar committed Oct 5, 2023
1 parent dc36a82 commit a13d156
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: chmod +x gradlew

- name: Build with gradle
uses: gradle/gradle-build-action@v2.8.0
uses: gradle/gradle-build-action@v2.9.0
with:
gradle-version: nightly
arguments: assembleDebug
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
run: chmod +x gradlew

- name: Build with gradle
uses: gradle/gradle-build-action@v2.8.0
uses: gradle/gradle-build-action@v2.9.0
with:
gradle-version: current
arguments: clean assembleDebug --no-build-cache

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: chmod +x gradlew

- name: Build with gradle
uses: gradle/gradle-build-action@v2.8.0
uses: gradle/gradle-build-action@v2.9.0
with:
gradle-version: nightly
arguments: assembleRelease
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:
- name: Give permission to executable
run: chmod +x gradlew

- name: Run tests
uses: gradle/[email protected]
with:
gradle-version: current
arguments: test --continue


- name: Run tests
run: ./gradlew test --continue

Expand All @@ -30,4 +37,3 @@ jobs:
with:
name: test-reports
path: '**/build/reports/tests/*'

2 changes: 0 additions & 2 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
/build
/src/main/assets/android.jar
/src/main/assets/core-lambda-stubs.jar
31 changes: 8 additions & 23 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android {
minSdk = 26
targetSdk = 34
versionCode = 23
versionName = "2.2.1"
versionName = "2.0.3"
buildConfigField("String", "GIT_COMMIT", "\"$commit\"")
}

Expand Down Expand Up @@ -94,28 +94,13 @@ android {
buildFeatures {
buildConfig = true
}
}

tasks.assemble {
dependsOn("copySdk")
}

// Copies `android.jar` and `core-lambda-stubs.jar` from Android SDK to app's assets.
// Note: The version used is the latest one installed on the machine.
tasks.create("copySdk") {
val assets = File(System.getProperty("user.dir") + "/app/src/main/assets")

val androidJar = assets.resolve("android.jar")
splits {
abi {
isEnable = true

if (androidJar.exists().not()) {
println("Copying SDK android.jar to ${androidJar.absolutePath}")
getAndroidJar().copyTo(androidJar)
}

val coreLambdaStubs = assets.resolve("core-lambda-stubs.jar")
if (coreLambdaStubs.exists().not()) {
println("Copying SDK core-lambda-stubs.jar to ${coreLambdaStubs.absolutePath}")
getCoreLambdaStubs().copyTo(coreLambdaStubs)
isUniversalApk = true
}
}
}

Expand Down Expand Up @@ -193,8 +178,8 @@ dependencies {
implementation("io.github.Rosemoe.sora-editor:language-treesitter:$editorVersion") {
isTransitive = false
}
implementation("com.itsaky.androidide:android-tree-sitter:3.3.0")
implementation("com.itsaky.androidide:tree-sitter-java:3.3.0")
implementation("com.itsaky.androidide:android-tree-sitter:3.4.0")
implementation("com.itsaky.androidide:tree-sitter-java:3.4.0")
implementation("io.github.itsaky:nb-javac-android:17.0.0.3")

implementation("org.eclipse.jgit:org.eclipse.jgit:5.13.2.202306221912-r")
Expand Down
Binary file added app/src/main/assets/android.jar
Binary file not shown.
Binary file added app/src/main/assets/core-lambda-stubs.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions jgit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {

dependencies {
implementation("org.eclipse.jgit:org.eclipse.jgit:5.13.2.202306221912-r")
implementation("org.eclipse.jgit:org.eclipse.jgit.pgm:6.7.0.202309050840-r") {
implementation("org.eclipse.jgit:org.eclipse.jgit.pgm:6.6.0.202305301015-r") {
exclude("net.java.dev.jna", "jna-platform")
exclude("net.java.dev.jna", "jna")
exclude("commons-logging", "commons-logging")
}
implementation("com.github.sya-ri:kgit:1.0.5")
}
}

0 comments on commit a13d156

Please sign in to comment.