Skip to content

Commit f21cf8f

Browse files
Update SDK targets to 37 and upgrade Gradle build configuration
1 parent 8be9089 commit f21cf8f

7 files changed

Lines changed: 55 additions & 52 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,8 @@ Thumbs.db
4242
*.bak
4343

4444
maven_push.gradle
45+
46+
library/build/
47+
sample/build/
48+
create-central-bundle.ps1
49+
HowToPublish.txt

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ buildscript {
77
}
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
11-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
12-
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
10+
classpath 'com.android.tools.build:gradle:9.2.1'
11+
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0'
1312
}
1413
}
1514

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip

library/build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'maven-publish'
32

43
ext {
54
PUBLISH_GROUP_ID = 'io.github.tutorialsandroid'
6-
PUBLISH_VERSION = '7.0.0'
5+
PUBLISH_VERSION = '7.0.1'
76
PUBLISH_ARTIFACT_ID = 'progressx'
87
PUBLISH_DESCRIPTION = 'A material style progress wheel that you can integrate into your app'
98
PUBLISH_URL = 'https://github.com/tutorialsandroid/progressx'
@@ -20,20 +19,25 @@ ext {
2019
PUBLISH_SCM_URL =
2120
'https://github.com/tutorialsandroid/progressx/tree/master'
2221
}
23-
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
2422

2523
android {
26-
compileSdk 34
24+
compileSdk 37
2725
namespace 'com.developer.progressx'
2826

2927
defaultConfig {
30-
minSdkVersion 19
31-
targetSdkVersion 34
28+
minSdkVersion 23
29+
targetSdkVersion 37
3230
}
3331
buildTypes {
3432
release {
3533
minifyEnabled false
36-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
34+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
35+
}
36+
}
37+
publishing {
38+
singleVariant("release") {
39+
withSourcesJar()
40+
withJavadocJar()
3741
}
3842
}
3943
compileOptions {
@@ -44,4 +48,6 @@ android {
4448

4549
dependencies {
4650
implementation fileTree(dir: 'libs', include: ['*.jar'])
47-
}
51+
}
52+
53+
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

sample/build.gradle

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

33
android {
4-
compileSdk 34
4+
compileSdk 37
55
namespace 'com.developer.progressx.custom'
66

77
defaultConfig {
88
applicationId "com.developer.progressx.custom"
9-
minSdkVersion 19
10-
targetSdkVersion 34
11-
versionCode 9
12-
versionName "7.0.0"
9+
minSdkVersion 23
10+
targetSdkVersion 37
11+
versionCode 10
12+
versionName "7.0.1"
1313
}
1414
buildTypes {
1515
release {
1616
minifyEnabled false
17-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18+
}
19+
20+
debug {
21+
minifyEnabled false
22+
debuggable true
1823
}
1924
}
2025
compileOptions {
@@ -27,7 +32,7 @@ dependencies {
2732
implementation fileTree(dir: 'libs', include: ['*.jar'])
2833

2934
//android support
30-
implementation 'androidx.appcompat:appcompat:1.6.1'
35+
implementation 'androidx.appcompat:appcompat:1.7.1'
3136

3237
//library
3338
implementation project(':library')

scripts/publish-module.gradle

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

4-
task androidSourcesJar(type: Jar) {
5-
archiveClassifier.set('sources')
6-
if (project.plugins.findPlugin("com.android.library")) {
7-
from android.sourceSets.main.java.srcDirs
8-
} else {
9-
from sourceSets.main.java.srcDirs
10-
}
11-
}
12-
13-
artifacts {
14-
archives androidSourcesJar
15-
}
16-
174
group = PUBLISH_GROUP_ID
185
version = PUBLISH_VERSION
196

207
afterEvaluate {
218
publishing {
229
publications {
2310
release(MavenPublication) {
24-
// The coordinates of the library, being set from variables that
25-
// we'll set up later
26-
groupId PUBLISH_GROUP_ID
27-
artifactId PUBLISH_ARTIFACT_ID
28-
version PUBLISH_VERSION
11+
from components.release
2912

30-
// Two artifacts, the `aar` (or `jar`) and the sources
31-
if (project.plugins.findPlugin("com.android.library")) {
32-
//from components.release
33-
} else {
34-
artifact("$buildDir/libs/${project.getName()}-${version}.jar")
35-
}
36-
37-
artifact bundleReleaseAar
13+
groupId = PUBLISH_GROUP_ID
14+
artifactId = PUBLISH_ARTIFACT_ID
15+
version = PUBLISH_VERSION
3816

39-
// Mostly self-explanatory metadata
4017
pom {
18+
packaging = 'aar'
19+
4120
name = PUBLISH_ARTIFACT_ID
4221
description = PUBLISH_DESCRIPTION
4322
url = PUBLISH_URL
23+
4424
licenses {
4525
license {
4626
name = PUBLISH_LICENSE_NAME
4727
url = PUBLISH_LICENSE_URL
4828
}
4929
}
30+
5031
developers {
5132
developer {
5233
id = PUBLISH_DEVELOPER_ID
@@ -55,8 +36,6 @@ afterEvaluate {
5536
}
5637
}
5738

58-
// Version control info - if you're using GitHub, follow the
59-
// format as seen here
6039
scm {
6140
connection = PUBLISH_SCM_CONNECTION
6241
developerConnection = PUBLISH_SCM_DEVELOPER_CONNECTION
@@ -66,12 +45,18 @@ afterEvaluate {
6645
}
6746
}
6847
}
69-
}
7048

49+
signing {
50+
required {
51+
gradle.taskGraph.allTasks.any { task ->
52+
task.name.toLowerCase().contains("publish")
53+
}
54+
}
55+
56+
sign publishing.publications.release
57+
}
58+
}
7159
ext["signing.keyId"] = rootProject.ext["signing.keyId"]
7260
ext["signing.password"] = rootProject.ext["signing.password"]
7361
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
7462

75-
signing {
76-
sign publishing.publications
77-
}

settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
plugins {
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
3+
}
14
include ':library', ':sample'

0 commit comments

Comments
 (0)