-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from velocitycareerlabs/VL-7885-rewrite-gradle
rewrite gradle
- Loading branch information
Showing
5 changed files
with
83 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ plugins { | |
|
||
android { | ||
compileSdk 34 | ||
// buildToolsVersion "30.0.3" | ||
namespace 'io.velocitycareerlabs' | ||
|
||
defaultConfig { | ||
|
@@ -88,31 +87,23 @@ def getGroupId = { -> | |
|
||
tasks.register('androidSourcesJar', Jar) { | ||
archiveClassifier.set('sources') | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
// For Android libraries | ||
from android.sourceSets.main.java.srcDirs | ||
from android.sourceSets.main.kotlin.srcDirs | ||
} else { | ||
// For pure Kotlin libraries, in case you have them | ||
from sourceSets.main.java.srcDirs | ||
from sourceSets.main.kotlin.srcDirs | ||
} | ||
from android.sourceSets.main.java.srcDirs | ||
from android.sourceSets.main.kotlin.srcDirs | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
archives tasks.named('androidSourcesJar') | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
rc(MavenPublication) { | ||
groupId getGroupId() | ||
artifactId getArtifactId() | ||
version getVersionName() | ||
create('rc', MavenPublication) { | ||
groupId = getGroupId() | ||
artifactId = getArtifactId() | ||
version = getVersionName() | ||
|
||
// Main artifact | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
if (project.plugins.hasPlugin("com.android.library")) { | ||
artifact("$buildDir/outputs/aar/${project.name}-release.aar") { | ||
builtBy tasks.named('assembleRelease') | ||
} | ||
|
@@ -122,46 +113,38 @@ afterEvaluate { | |
} | ||
} | ||
|
||
// Sources jar artifact | ||
artifact(tasks.named('androidSourcesJar')) | ||
|
||
// Mostly self-explanatory metadata | ||
pom { | ||
name = getArtifactId() | ||
// Library description | ||
description = 'Velocity Career Labs Android library' | ||
// Library Github URL | ||
url = 'https://github.com/velocitycareerlabs/WalletAndroid' | ||
name.set(getArtifactId()) | ||
description.set('Velocity Career Labs Android library') | ||
url.set('https://github.com/velocitycareerlabs/WalletAndroid') | ||
licenses { | ||
license { | ||
name = 'Apache License 2.0' | ||
// Library license | ||
url = 'https://github.com/velocitycareerlabs/WalletAndroid/blob/dev/VCL/LICENSE' | ||
name.set('Apache License 2.0') | ||
url.set('https://github.com/velocitycareerlabs/WalletAndroid/blob/dev/VCL/LICENSE') | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'velocitycareerlabs' | ||
name = 'Michael Avoyan' | ||
email = '[email protected]' | ||
id.set('velocitycareerlabs') | ||
name.set('Michael Avoyan') | ||
email.set('[email protected]') | ||
} | ||
} | ||
|
||
scm { | ||
// Library info on Github | ||
connection = 'scm:github.com/velocitycareerlabs/WalletAndroid.git' | ||
developerConnection = 'scm:git:ssh://github.com/velocitycareerlabs/WalletAndroid.git' | ||
url = 'https://github.com/velocitycareerlabs/WalletAndroid' | ||
connection.set('scm:github.com/velocitycareerlabs/WalletAndroid.git') | ||
developerConnection.set('scm:git:ssh://github.com/velocitycareerlabs/WalletAndroid.git') | ||
url.set('https://github.com/velocitycareerlabs/WalletAndroid') | ||
} | ||
} | ||
} | ||
release(MavenPublication) { | ||
groupId getGroupId() | ||
artifactId getArtifactId() | ||
version getVersionName() | ||
create('release', MavenPublication) { | ||
groupId = getGroupId() | ||
artifactId = getArtifactId() | ||
version = getVersionName() | ||
|
||
// Main artifact | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
if (project.plugins.hasPlugin("com.android.library")) { | ||
artifact("$buildDir/outputs/aar/${project.name}-release.aar") { | ||
builtBy tasks.named('assembleRelease') | ||
} | ||
|
@@ -171,36 +154,29 @@ afterEvaluate { | |
} | ||
} | ||
|
||
// Sources jar artifact | ||
artifact(tasks.named('androidSourcesJar')) | ||
|
||
// Mostly self-explanatory metadata | ||
pom { | ||
name = getArtifactId() | ||
// Library description | ||
description = 'Velocity Career Labs Android library' | ||
// Library Github URL | ||
url = 'https://github.com/velocitycareerlabs/WalletAndroid' | ||
name.set(getArtifactId()) | ||
description.set('Velocity Career Labs Android library') | ||
url.set('https://github.com/velocitycareerlabs/WalletAndroid') | ||
licenses { | ||
license { | ||
name = 'Apache License 2.0' | ||
// Library license | ||
url = 'https://github.com/velocitycareerlabs/WalletAndroid/blob/dev/VCL/LICENSE' | ||
name.set('Apache License 2.0') | ||
url.set('https://github.com/velocitycareerlabs/WalletAndroid/blob/dev/VCL/LICENSE') | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'velocitycareerlabs' | ||
name = 'Michael Avoyan' | ||
email = '[email protected]' | ||
id.set('velocitycareerlabs') | ||
name.set('Michael Avoyan') | ||
email.set('[email protected]') | ||
} | ||
} | ||
|
||
scm { | ||
// Library info on Github | ||
connection = 'scm:github.com/velocitycareerlabs/WalletAndroid.git' | ||
developerConnection = 'scm:git:ssh://github.com/velocitycareerlabs/WalletAndroid.git' | ||
url = 'https://github.com/velocitycareerlabs/WalletAndroid' | ||
connection.set('scm:github.com/velocitycareerlabs/WalletAndroid.git') | ||
developerConnection.set('scm:git:ssh://github.com/velocitycareerlabs/WalletAndroid.git') | ||
url.set('https://github.com/velocitycareerlabs/WalletAndroid') | ||
} | ||
} | ||
} | ||
|
@@ -213,21 +189,23 @@ afterEvaluate { | |
rootProject.ext.signingPrivateKey, | ||
rootProject.ext.signingPassword | ||
) | ||
sign publishing.publications | ||
sign(publishing.publications) | ||
// sign(publishing.publications['rc']) | ||
// sign(publishing.publications['release']) | ||
} | ||
|
||
tasks.named('generateMetadataFileForRcPublication') { | ||
dependsOn tasks.named('androidSourcesJar') | ||
dependsOn(tasks.named('androidSourcesJar')) | ||
} | ||
|
||
tasks.named("publishRcPublicationToSonatypeRepository").configure { | ||
dependsOn tasks.named("signRcPublication") | ||
dependsOn tasks.named("signReleasePublication") | ||
tasks.named("publishRcPublicationToSonatypeRepository") { | ||
dependsOn(tasks.named("signRcPublication")) | ||
dependsOn(tasks.named("signReleasePublication")) | ||
} | ||
|
||
tasks.named("publishReleasePublicationToSonatypeRepository").configure { | ||
dependsOn tasks.named("signReleasePublication") | ||
dependsOn tasks.named("signRcPublication") | ||
tasks.named("publishReleasePublicationToSonatypeRepository") { | ||
dependsOn(tasks.named("signReleasePublication")) | ||
dependsOn(tasks.named("signRcPublication")) | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters