Skip to content

Commit 20d89c1

Browse files
authored
Upgrade to Gradle 6.7.1 (#46)
1 parent 00966da commit 20d89c1

File tree

18 files changed

+263
-335
lines changed

18 files changed

+263
-335
lines changed

.github/workflows/compile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
- name: Setup Android build environment
2626
uses: android-actions/[email protected]
2727
- name: Local install
28-
run: ./gradlew clean uploadArchives -PSNAPSHOT=true -PLOCAL=true
28+
run: ./gradlew clean publishToMavenLocal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ After including the dependencies and refreshing, you can use the `NoGameServiceC
7272
### Building from source
7373
To build from source, clone or download this repository, then open it in Android Studio. Perform the following command to compile and upload the library in your local repository:
7474

75-
gradlew clean uploadArchives -PLOCAL=true
75+
gradlew clean publishToMavenLocal
7676

7777
See `build.gradle` file for current version to use in your dependencies.
7878

android-amazongc/build.gradle

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,33 @@
1-
apply plugin: 'com.android.library'
2-
3-
project.group = 'de.golfgl.gdxgamesvcs'
4-
5-
buildscript {
6-
repositories {
7-
maven { url 'https://plugins.gradle.org/m2/' }
8-
google()
9-
}
10-
11-
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.2.0'
13-
}
14-
}
15-
161
android {
17-
compileSdkVersion compileSdk
18-
buildToolsVersion "${buildTools}"
2+
compileSdkVersion compileSdkVer
193

204
defaultConfig {
21-
minSdkVersion minSdk
22-
targetSdkVersion targetSdk
5+
minSdkVersion minSdkVer
6+
targetSdkVersion targetSdkVer
237
}
248

259
sourceSets {
2610
main {
2711
manifest.srcFile 'AndroidManifest.xml'
2812
java.srcDirs = ['src']
2913
res.srcDirs = ['res']
30-
3114
}
3215
}
3316

3417
compileOptions {
3518
sourceCompatibility JavaVersion.VERSION_1_7
3619
targetCompatibility JavaVersion.VERSION_1_7
3720
}
38-
39-
4021
}
4122

4223
dependencies {
43-
compile project(":core")
44-
compile files('libs/gamecirclesdk.jar')
45-
compile files('libs/login-with-amazon-sdk.jar')
46-
compile files('libs/AmazonInsights-android-sdk-2.1.26.jar')
24+
implementation files('libs/gamecirclesdk.jar')
25+
implementation files('libs/login-with-amazon-sdk.jar')
26+
implementation files('libs/AmazonInsights-android-sdk-2.1.26.jar')
4727
}
4828

4929
ext {
5030
ARTIFACTID = 'gdx-gamesvcs-android-amazongc'
5131
}
5232

5333
apply from: '../androidpublish.gradle'
54-

android-gpgs/build.gradle

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
1-
apply plugin: 'com.android.library'
2-
3-
project.group = 'de.golfgl.gdxgamesvcs'
4-
51
buildscript {
62
repositories {
7-
maven { url 'https://plugins.gradle.org/m2/' }
83
google()
4+
gradlePluginPortal()
95
}
106

117
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.2.0'
8+
classpath 'com.google.gms:google-services:4.3.10'
139
}
1410
}
1511

12+
apply plugin: 'com.google.gms.google-services'
13+
1614
android {
17-
compileSdkVersion compileSdk
18-
buildToolsVersion "${buildTools}"
15+
compileSdkVersion compileSdkVer
1916

2017
defaultConfig {
21-
minSdkVersion minSdk
22-
targetSdkVersion targetSdk
18+
minSdkVersion minSdkVer
19+
targetSdkVersion targetSdkVer
2320
}
2421

2522
sourceSets {
2623
main {
2724
manifest.srcFile 'AndroidManifest.xml'
2825
java.srcDirs = ['src']
2926
res.srcDirs = ['res']
30-
3127
}
3228
}
3329

3430
compileOptions {
3531
sourceCompatibility JavaVersion.VERSION_1_7
3632
targetCompatibility JavaVersion.VERSION_1_7
3733
}
34+
}
3835

39-
36+
dependencies {
37+
implementation 'com.google.android.gms:play-services-auth:19.2.0'
38+
implementation 'com.google.android.gms:play-services-games:21.0.0'
4039
}
4140

4241
ext {
4342
ARTIFACTID = 'gdx-gamesvcs-android-gpgs'
4443
}
4544

46-
apply from: '../androidpublish.gradle'
45+
apply from: '../androidpublish.gradle'

android-gpgs/src/de/golfgl/gdxgamesvcs/GpgsClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
import android.content.Intent;
55
import android.os.AsyncTask;
66
import android.os.Bundle;
7-
import android.support.annotation.NonNull;
8-
import android.support.annotation.Nullable;
7+
8+
import androidx.annotation.NonNull;
9+
import androidx.annotation.Nullable;
910

1011
import com.badlogic.gdx.Gdx;
1112
import com.badlogic.gdx.backends.android.AndroidApplication;

android-huawei/build.gradle

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,44 @@
1-
apply plugin: 'com.android.library'
2-
3-
project.group = 'de.golfgl.gdxgamesvcs'
4-
51
buildscript {
62
repositories {
7-
maven { url 'https://plugins.gradle.org/m2/' }
83
google()
4+
gradlePluginPortal()
95
maven { url 'https://developer.huawei.com/repo/' }
106
}
117

128
dependencies {
13-
classpath 'com.android.tools.build:gradle:3.2.0'
149
classpath 'com.huawei.agconnect:agcp:1.3.2.301'
1510
}
1611
}
1712

1813
android {
19-
compileSdkVersion compileSdk
20-
buildToolsVersion "${buildTools}"
14+
compileSdkVersion compileSdkVer
2115

2216
defaultConfig {
23-
minSdkVersion 17
24-
targetSdkVersion targetSdk
17+
minSdkVersion minSdkVer
18+
targetSdkVersion targetSdkVer
2519
}
2620

2721
sourceSets {
2822
main {
2923
manifest.srcFile 'AndroidManifest.xml'
3024
java.srcDirs = ['src']
3125
res.srcDirs = ['res']
32-
3326
}
3427
}
3528

3629
compileOptions {
3730
sourceCompatibility JavaVersion.VERSION_1_7
3831
targetCompatibility JavaVersion.VERSION_1_7
3932
}
40-
41-
4233
}
4334

4435
dependencies {
45-
implementation project(":core")
4636
implementation 'com.huawei.hms:game:5.0.1.301'
4737
implementation 'com.huawei.hms:hwid:5.0.1.301'
48-
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
4938
}
5039

5140
ext {
5241
ARTIFACTID = 'gdx-gamesvcs-android-huawei'
5342
}
5443

55-
apply from: '../androidpublish.gradle'
44+
apply from: '../androidpublish.gradle'

androidpublish.gradle

Lines changed: 67 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apply plugin: 'maven'
1+
apply plugin: 'maven-publish'
22
apply plugin: 'signing'
33

44
def isLocalBuild() {
@@ -52,95 +52,89 @@ def getVersion() {
5252
}
5353
}
5454

55+
task androidJavadocs(type: Javadoc) {
56+
source = android.sourceSets.main.java.srcDirs
57+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
58+
options.addStringOption('Xdoclint:none', '-quiet')
59+
}
5560

56-
uploadArchives {
57-
repositories {
58-
mavenDeployer {
59-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
60-
61-
pom.groupId = getGroupId()
62-
pom.version = getVersion()
63-
pom.artifactId = getArtifactId()
61+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
62+
archiveClassifier.set('javadoc')
63+
from androidJavadocs.destinationDir
64+
}
6465

65-
if (isLocalBuild()) {
66-
repository(url: getLocalRepositoryUrl())
67-
} else {
68-
if (isReleaseBuild()) {
69-
repository(url: getReleaseRepositoryUrl()) {
70-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
71-
}
72-
}
73-
if (isSnapshotBuild()) {
74-
snapshotRepository(url: getSnapshotRepositoryUrl()) {
75-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
76-
}
77-
}
78-
}
66+
task androidSourcesJar(type: Jar) {
67+
archiveClassifier.set('sources')
68+
from android.sourceSets.main.java.srcDirs
69+
}
7970

71+
afterEvaluate { //For android we need to wrap the publishing inside afterEvaluate
72+
publishing {
73+
publications {
74+
release(MavenPublication) {
75+
from components.release
8076

77+
groupId = GROUPID
78+
artifactId = ARTIFACTID
79+
version = getVersion()
8180

81+
println 'Publishing artifact: ' + GROUPID + ':' + ARTIFACTID + '-' + getVersion()
8282

83-
pom.project {
84-
name 'gdx-gamesvcs'
85-
description 'Gameservices APIs for libGDX'
86-
url 'https://github.com/MrStahlfelge/gdx-gamesvcs'
83+
pom {
84+
name = libraryName
85+
description = libraryDescription
86+
url = librarySiteUrl
8787

88-
scm {
89-
url 'scm:[email protected]:MrStahlfelge/gdx-gamesvcs.git'
90-
connection 'scm:[email protected]:MrStahlfelge/gdx-gamesvcs.git'
91-
developerConnection 'scm:[email protected]:MrStahlfelge/gdx-gamesvcs.git'
92-
}
88+
licenses {
89+
license {
90+
name = licenseName
91+
url = licenseUrl
92+
}
93+
}
9394

94-
licenses {
95-
license {
96-
name 'The Apache Software License, Version 2.0'
97-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
98-
distribution 'repo'
95+
developers {
96+
developer {
97+
id = developerId
98+
name = developerName
99+
email = developerEmail
100+
}
99101
}
100-
}
101102

102-
developers {
103-
developer {
104-
id 'MrStahlfelge'
105-
name 'Benjamin Schulte'
106-
103+
scm {
104+
url = libraryGitUrl
105+
connection = "scm:$libraryGitUrl"
106+
developerConnection = "scm:$libraryGitUrl"
107107
}
108108
}
109109
}
110110
}
111-
}
112-
}
113111

114-
signing {
115-
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
116-
sign configurations.archives
117-
}
112+
repositories {
113+
if (isReleaseBuild()) {
114+
maven {
115+
credentials {
116+
username = getRepositoryUsername()
117+
password = getRepositoryPassword()
118+
}
118119

120+
url getReleaseRepositoryUrl()
121+
}
122+
}
123+
if (isSnapshotBuild()) {
124+
maven {
125+
credentials {
126+
username = getRepositoryUsername()
127+
password = getRepositoryPassword()
128+
}
119129

120-
task androidJavadocs(type: Javadoc) {
121-
source = android.sourceSets.main.java.srcDirs
122-
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
123-
// JDK 1.8 is more strict then 1.7. Have JDK 1.8 behave like 1.7 for javadoc generation
124-
if (org.gradle.internal.jvm.Jvm.current().getJavaVersion() == JavaVersion.VERSION_1_8) {
125-
options.addStringOption('Xdoclint:none', '-quiet')
130+
url getSnapshotRepositoryUrl()
131+
}
132+
}
133+
}
126134
}
127-
}
128-
129-
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
130-
classifier = 'javadoc'
131-
from androidJavadocs.destinationDir
132-
}
133135

134-
task androidSourcesJar(type: Jar) {
135-
classifier = 'sources'
136-
from android.sourceSets.main.java.sourceFiles
137-
}
138-
139-
artifacts {
140-
archives androidSourcesJar
141-
archives androidJavadocsJar
136+
signing {
137+
required { isReleaseBuild() }
138+
sign publishing.publications.release
139+
}
142140
}
143-
144-
afterEvaluate {
145-
androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
146-
}

0 commit comments

Comments
 (0)