Skip to content

Commit 1369a48

Browse files
committed
[lib] update modern android lib builder
- gradle wrapper 8.10.2 - agp 8.7.2
1 parent bd17398 commit 1369a48

File tree

9 files changed

+318
-205
lines changed

9 files changed

+318
-205
lines changed

lib/android-jsc/build.gradle

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'maven-publish'
23

34
def distDir = project.findProperty("distDir") ?: ""
45
def jniLibsDir = project.findProperty("jniLibsDir") ?: ""
@@ -11,42 +12,54 @@ if (!revision) throw new RuntimeException("expecting --project-prop revision=???
1112
if (!i18n) throw new RuntimeException("expecting --project-prop i18n=??? but was empty")
1213

1314
android {
14-
compileSdkVersion 28
15+
namespace 'org.webkit.androidjsc'
16+
compileSdkVersion 35
1517

16-
defaultConfig {
17-
minSdkVersion 16
18-
targetSdkVersion 28
19-
versionCode 1
20-
versionName "1.0"
21-
}
18+
defaultConfig {
19+
minSdkVersion 24
20+
targetSdkVersion 34
21+
versionCode 1
22+
versionName "1.0"
23+
}
2224

23-
sourceSets {
24-
main {
25-
jniLibs.srcDirs = ["${jniLibsDir}"]
26-
}
25+
sourceSets {
26+
main {
27+
jniLibs.srcDirs = ["${jniLibsDir}"]
2728
}
29+
}
30+
31+
packagingOptions {
32+
doNotStrip "**/libjsc.so"
33+
}
2834

29-
packagingOptions {
30-
doNotStrip "**/libjsc.so"
35+
publishing {
36+
singleVariant("release") {
3137
}
38+
}
3239
}
3340

3441
dependencies {}
3542

36-
apply plugin: 'maven'
43+
project.group = "org.webkit"
44+
def artifactName = Boolean.valueOf(i18n) ? "android-jsc-intl" : "android-jsc"
45+
project.version = "r${revision}"
3746

38-
task createAAR(type: Upload) {
39-
project.group = "org.webkit"
40-
def artifactName = Boolean.valueOf(i18n) ? "android-jsc-intl" : "android-jsc"
41-
project.version = "r${revision}"
42-
43-
configuration = configurations.archives
44-
repositories.mavenDeployer {
45-
repository url: "file://${distDir}"
46-
pom.project {
47-
name "android-jsc"
48-
artifactId artifactName
49-
packaging "aar"
47+
afterEvaluate {
48+
publishing {
49+
publications {
50+
release(MavenPublication) {
51+
from components.release
52+
pom {
53+
name = "android-jsc"
54+
artifactId = artifactName
55+
packaging = "aar"
5056
}
57+
}
58+
}
59+
repositories {
60+
maven {
61+
url = "file://${distDir}"
62+
}
5163
}
64+
}
5265
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="org.webkit.androidjsc" />
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />

lib/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
buildscript {
44
repositories {
55
google()
6-
jcenter()
76
mavenCentral()
87
mavenLocal()
98
}
109
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.2.0'
10+
classpath 'com.android.tools.build:gradle:8.7.2'
1211

1312
// NOTE: Do not place your application dependencies here; they belong
1413
// in the individual module build.gradle files
@@ -18,7 +17,6 @@ buildscript {
1817
allprojects {
1918
repositories {
2019
google()
21-
jcenter()
2220
mavenCentral()
2321
mavenLocal()
2422
}

lib/cppruntime/build.gradle

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'maven-publish'
23

34
def distDir = project.findProperty("distDir") ?: ""
45
def jniLibsDir = project.findProperty("jniLibsDir") ?: ""
@@ -9,37 +10,49 @@ if (!jniLibsDir) throw new RuntimeException("expecting --project-prop jniLibsDir
910
if (!revision) throw new RuntimeException("expecting --project-prop revision=??? but was empty")
1011

1112
android {
12-
compileSdkVersion 28
13-
14-
defaultConfig {
15-
minSdkVersion 16
16-
targetSdkVersion 28
17-
versionCode 1
18-
versionName "1.0"
13+
namespace 'org.webkit.androidjsc_cppruntime'
14+
compileSdkVersion 35
15+
16+
defaultConfig {
17+
minSdkVersion 24
18+
targetSdkVersion 34
19+
versionCode 1
20+
versionName "1.0"
21+
}
22+
23+
sourceSets {
24+
main {
25+
jniLibs.srcDirs = ["${jniLibsDir}"]
1926
}
27+
}
2028

21-
sourceSets {
22-
main {
23-
jniLibs.srcDirs = ["${jniLibsDir}"]
24-
}
29+
publishing {
30+
singleVariant("release") {
2531
}
32+
}
2633
}
2734

2835
dependencies {}
2936

30-
apply plugin: 'maven'
31-
32-
task createAAR(type: Upload) {
33-
project.group = "org.webkit"
34-
project.version = "r${revision}"
35-
36-
configuration = configurations.archives
37-
repositories.mavenDeployer {
38-
repository url: "file://${distDir}"
39-
pom.project {
40-
name "android-jsc"
41-
artifactId "android-jsc-cppruntime"
42-
packaging "aar"
37+
project.group = "org.webkit"
38+
project.version = "r${revision}"
39+
40+
afterEvaluate {
41+
publishing {
42+
publications {
43+
release(MavenPublication) {
44+
from components.release
45+
pom {
46+
name = "android-jsc"
47+
artifactId = "android-jsc-cppruntime"
48+
packaging = "aar"
4349
}
50+
}
51+
}
52+
repositories {
53+
maven {
54+
url = "file://${distDir}"
55+
}
4456
}
57+
}
4558
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="org.webkit.androidjsc_cppruntime" />
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />

lib/gradle/wrapper/gradle-wrapper.jar

-10.6 KB
Binary file not shown.

lib/gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Tue May 15 12:33:24 IDT 2018
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip

0 commit comments

Comments
 (0)