-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed release process to use maven publish plugin directly (#739)
- Loading branch information
Showing
11 changed files
with
244 additions
and
78 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. | ||
version: v1.25.0 | ||
# ignores vulnerabilities until expiry date; change duration by modifying expiry date | ||
ignore: | ||
SNYK-JAVA-COMFASTERXMLWOODSTOX-3091135: | ||
- '*': | ||
reason: Latest version of dokka has this vulnerability | ||
expires: 2024-06-27T07:00:56.333Z | ||
created: 2024-05-28T07:00:56.334Z | ||
SNYK-JAVA-ORGJETBRAINSKOTLIN-2393744: | ||
- '*': | ||
reason: Latest version of dokka has this vulnerability | ||
expires: 2024-06-27T07:01:24.820Z | ||
created: 2024-05-28T07:01:24.825Z | ||
patch: {} |
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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
apply plugin: 'jacoco' | ||
|
||
jacoco { | ||
toolVersion = "0.8.5" | ||
} | ||
|
||
android { | ||
testOptions { | ||
unitTests.all { | ||
jacoco { | ||
includeNoLocationClasses = true | ||
jacoco.excludes = ['jdk.internal.*'] | ||
} | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
def jacocoTestReportTask = tasks.findByName("jacocoTestReport") | ||
if (!jacocoTestReportTask) { | ||
jacocoTestReportTask = tasks.create("jacocoTestReport") | ||
jacocoTestReportTask.group = "Reporting" | ||
jacocoTestReportTask.description = "Generate Jacoco coverage reports for all builds." | ||
} | ||
|
||
android.libraryVariants.all { variant -> | ||
def name = variant.name | ||
def testTaskName = "test${name.capitalize()}UnitTest" | ||
|
||
def reportTask = tasks.create(name: "jacocoTest${name.capitalize()}UnitTestReport", type: JacocoReport, dependsOn: testTaskName) { | ||
group = "Reporting" | ||
description = "Generate Jacoco coverage reports for the ${name.capitalize()} build." | ||
|
||
classDirectories.from = fileTree( | ||
dir: "${buildDir}/intermediates/javac/${name}", | ||
excludes: ['**/R.class', | ||
'**/R$*.class', | ||
'**/*$ViewInjector*.*', | ||
'**/*$ViewBinder*.*', | ||
'**/BuildConfig.*', | ||
'**/Manifest*.*'] | ||
) | ||
|
||
sourceDirectories.from = ['src/main/java'].plus(android.sourceSets[name].java.srcDirs) | ||
executionData.from = "${buildDir}/jacoco/${testTaskName}.exec" | ||
|
||
reports { | ||
xml.enabled = true | ||
html.enabled = true | ||
} | ||
} | ||
jacocoTestReportTask.dependsOn reportTask | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
|
||
apply from: rootProject.file('gradle/versioning.gradle') | ||
|
||
task javadocJar(type: Jar, dependsOn: dokkaHtml) { | ||
archiveClassifier = "javadoc" | ||
from dokkaHtml.outputDirectory | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
archiveClassifier = 'sources' | ||
from android.sourceSets.main.java.source | ||
} | ||
|
||
final releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
final snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
|
||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId = GROUP | ||
artifactId = POM_ARTIFACT_ID | ||
version = getVersionName() | ||
|
||
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") | ||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
pom { | ||
name = POM_NAME | ||
packaging = POM_PACKAGING | ||
description = POM_DESCRIPTION | ||
url = POM_URL | ||
|
||
licenses { | ||
license { | ||
name = POM_LICENCE_NAME | ||
url = POM_LICENCE_URL | ||
distribution = POM_LICENCE_DIST | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = POM_DEVELOPER_ID | ||
name = POM_DEVELOPER_NAME | ||
email = POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
|
||
scm { | ||
url = POM_SCM_URL | ||
connection = POM_SCM_CONNECTION | ||
developerConnection = POM_SCM_DEV_CONNECTION | ||
} | ||
|
||
withXml { | ||
def dependenciesNode = asNode().appendNode('dependencies') | ||
|
||
project.configurations.implementation.allDependencies.each { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
dependencyNode.appendNode('version', it.version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = "sonatype" | ||
url = version.endsWith('SNAPSHOT') ? snapshotRepositoryUrl : releaseRepositoryUrl | ||
credentials { | ||
username = System.getenv("MAVEN_USERNAME") | ||
password = System.getenv("MAVEN_PASSWORD") | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
signing { | ||
def signingKey = System.getenv("SIGNING_KEY") | ||
def signingPassword = System.getenv("SIGNING_PASSWORD") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications | ||
} | ||
|
||
|
||
publish.dependsOn build | ||
tasks.named('signReleasePublication').configure { | ||
dependsOn 'bundleReleaseAar' | ||
} | ||
|
Oops, something went wrong.