Skip to content

Commit 9c841fb

Browse files
committed
Update Android Gradle Plugin and CI (Java 17)
1 parent 54d5ccc commit 9c841fb

13 files changed

Lines changed: 79 additions & 82 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
- uses: actions/checkout@v3
1111
- uses: actions/setup-node@v3
1212
with:
13-
node-version: '16'
14-
- run: echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager "ndk;21.0.6113669"
13+
node-version: '18'
14+
- uses: android-actions/setup-android@v3
15+
- run: sdkmanager "ndk;27.1.12297006"
1516
- run: npm i -g electrode-native
1617
- uses: actions/checkout@v3
1718
with:
1819
repository: electrode-io/electrode-native
19-
path: electrode-native
2020
- working-directory: electrode-native/
2121
run: node setup-dev.js
2222
- run: ern platform use 1000.0.0
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@v3
3232
- uses: actions/setup-node@v3
3333
with:
34-
node-version: '16'
34+
node-version: '18'
3535
- uses: maxim-lobanov/setup-xcode@v1
3636
with:
3737
xcode-version: '12.4.0'

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v3
1111
- uses: actions/setup-node@v3
1212
with:
13-
node-version: '16'
13+
node-version: '18'
1414
registry-url: 'https://registry.npmjs.org'
1515
- run: yarn --frozen-lockfile
1616
- run: npm publish --access public

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
buildscript {
22
repositories {
33
google()
4-
jcenter()
4+
mavenCentral()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:3.5.3'
7+
classpath 'com.android.tools.build:gradle:8.7.2'
88
}
99
}
1010

1111
allprojects {
1212
repositories {
1313
google()
14-
jcenter()
14+
mavenCentral()
1515
mavenLocal()
1616
}
1717
}
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 30
5-
buildToolsVersion "30.0.3"
4+
namespace 'com.walmartlabs.ern.navigation.support.lib'
5+
compileSdkVersion 35
6+
buildToolsVersion "35.0.0"
67

78
defaultConfig {
8-
minSdkVersion 19
9-
targetSdkVersion 30
9+
minSdkVersion 24
10+
targetSdkVersion 35
1011
versionCode 1
1112
versionName "1.0"
1213

@@ -21,15 +22,15 @@ android {
2122
}
2223
}
2324
compileOptions {
24-
sourceCompatibility JavaVersion.VERSION_1_8
25-
targetCompatibility JavaVersion.VERSION_1_8
25+
sourceCompatibility JavaVersion.VERSION_17
26+
targetCompatibility JavaVersion.VERSION_17
2627
}
2728
}
2829

2930
dependencies {
30-
implementation 'androidx.appcompat:appcompat:1.2.0'
31+
implementation 'androidx.appcompat:appcompat:1.7.0'
3132
testImplementation 'junit:junit:4.13.2'
32-
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
33-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
33+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
34+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
3435
}
3536
apply from: 'maven-publish.gradle'

android/ern-navigation-support-lib/maven-publish.gradle

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
apply plugin: 'maven'
17+
apply plugin: 'maven-publish'
1818
apply plugin: 'signing'
1919

2020
def isReleaseBuild() {
@@ -39,66 +39,63 @@ def getRepositoryPassword() {
3939
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
4040
}
4141

42-
afterEvaluate { project ->
43-
uploadArchives {
44-
repositories {
45-
mavenDeployer {
46-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
47-
48-
pom.groupId = GROUP
49-
pom.artifactId = POM_ARTIFACT_ID
50-
pom.version = VERSION_NAME
51-
52-
repository(url: getReleaseRepositoryUrl()) {
53-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
54-
}
55-
snapshotRepository(url: getSnapshotRepositoryUrl()) {
56-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
57-
}
42+
task androidSourcesJar(type: Jar) {
43+
archiveClassifier = 'sources'
44+
from android.sourceSets.main.java.srcDirs
45+
}
5846

59-
pom.project {
60-
name POM_NAME
61-
packaging POM_PACKAGING
62-
description POM_DESCRIPTION
63-
url POM_URL
47+
afterEvaluate {
48+
publishing {
49+
publications {
50+
release(MavenPublication) {
51+
from components.default
52+
groupId = GROUP
53+
artifactId = POM_ARTIFACT_ID
54+
version = VERSION_NAME
55+
56+
pom {
57+
name = POM_NAME
58+
packaging = POM_PACKAGING
59+
description = POM_DESCRIPTION
60+
url = POM_URL
6461

6562
scm {
66-
url POM_SCM_URL
67-
connection POM_SCM_CONNECTION
68-
developerConnection POM_SCM_DEV_CONNECTION
63+
url = POM_SCM_URL
64+
connection = POM_SCM_CONNECTION
65+
developerConnection = POM_SCM_DEV_CONNECTION
6966
}
7067

7168
licenses {
7269
license {
73-
name POM_LICENCE_NAME
74-
url POM_LICENCE_URL
75-
distribution POM_LICENCE_DIST
70+
name = POM_LICENCE_NAME
71+
url = POM_LICENCE_URL
72+
distribution = POM_LICENCE_DIST
7673
}
7774
}
7875

7976
developers {
8077
developer {
81-
id POM_DEVELOPER_ID
82-
name POM_DEVELOPER_NAME
78+
id = POM_DEVELOPER_ID
79+
name = POM_DEVELOPER_NAME
8380
}
8481
}
8582
}
8683
}
8784
}
85+
repositories {
86+
maven {
87+
def releasesRepoUrl = getReleaseRepositoryUrl()
88+
def snapshotsRepoUrl = getSnapshotRepositoryUrl()
89+
url = isReleaseBuild() ? releasesRepoUrl : snapshotsRepoUrl
90+
credentials {
91+
username = getRepositoryUsername()
92+
password = getRepositoryPassword()
93+
}
94+
}
95+
}
8896
}
89-
9097
signing {
91-
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
92-
sign configurations.archives
93-
}
94-
95-
96-
task androidSourcesJar(type: Jar) {
97-
archiveClassifier.set("sources")
98-
from android.sourceSets.main.java.sourceFiles
99-
}
100-
101-
artifacts {
102-
archives androidSourcesJar
98+
required { isReleaseBuild() && gradle.taskGraph.hasTask("publish") }
99+
sign publishing.publications.release
103100
}
104101
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.walmartlabs.ern.navigation.res.lib">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
</manifest>

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12-
org.gradle.jvmargs=-Xmx1536m
12+
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
1313

1414
# When configured, Gradle will run in incubating parallel mode.
1515
# This option should only be used with decoupled projects. More details, visit
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

android/lib/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 28
5-
buildToolsVersion "28.0.3"
4+
namespace 'com.walmartlabs.ern.navigation'
5+
compileSdkVersion 35
6+
buildToolsVersion "35.0.0"
67
defaultConfig {
7-
minSdkVersion 19
8-
targetSdkVersion 28
8+
minSdkVersion 24
9+
targetSdkVersion 35
910
versionCode 1
1011
versionName "1.0"
1112
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -28,8 +29,8 @@ android {
2829
unitTests.returnDefaultValues = true
2930
}
3031
compileOptions {
31-
sourceCompatibility = '1.8'
32-
targetCompatibility = '1.8'
32+
sourceCompatibility JavaVersion.VERSION_17
33+
targetCompatibility JavaVersion.VERSION_17
3334
}
3435
}
3536

android/lib/src/androidTest/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.walmartlabs.ern.navigation.sample">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32

43
<application>
54
<activity

0 commit comments

Comments
 (0)