Skip to content

Commit

Permalink
Add revision: v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GovernikusAusweisApp2 committed Oct 24, 2024
1 parent 66923d7 commit 69b3088
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 128 deletions.
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ systemProp.sonar.host.url=https://sonar.govkg.de
systemProp.sonar.projectKey=SDKWrapper-Android
systemProp.sonar.sourceEncoding=UTF-8
systemProp.sonar.language=kotlin

signing.gnupg.keyName=
signing.gnupg.passphrase=
37 changes: 16 additions & 21 deletions jenkins/PipelineBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ pipeline {
string( name: 'REVIEWBOARD_STATUS_UPDATE_ID', defaultValue: '', description: '' )
string( name: 'REVIEWBOARD_DIFF_REVISION', defaultValue: '', description: '' )
booleanParam( name: 'performSonarScan', defaultValue: false, description: 'Perform a sonar scan')
booleanParam( name: 'mavenPublishSnapshot', defaultValue: false, description: 'Publish snapshot artifacts to maven repository')
booleanParam( name: 'publishRelease', defaultValue: false, description: 'Publish release')
string( name: 'publish', defaultValue: '', description: 'Publish (snapshot | release | central) repository')
string( name: 'aarSource', defaultValue: 'maven', description: 'Source of the AAR.\nExamples: maven, Release_Android_AAR, default_Review_Android_AAR, default_Android_AAR' )
}
options {
Expand Down Expand Up @@ -92,41 +91,36 @@ pipeline {
when { expression { params.performSonarScan } }
steps {
script {
if (params.REVIEWBOARD_REVIEW_ID != '') {
sh './gradlew sonar -Dsonar.plugins.downloadOnlyRequired=false -Dsonar.scanner.metadataFilePath=${WORKSPACE}/tmp/sonar-metadata.txt -Dsonar.pullrequest.key=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.branch=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.base=${REVIEWBOARD_REVIEW_BRANCH} -Dsonar.token=${SONARQUBE_TOKEN} -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=90'
} else {
sh './gradlew sonar -Dsonar.plugins.downloadOnlyRequired=false -Dsonar.branch.name=${REVIEWBOARD_REVIEW_BRANCH} -Dsonar.token=${SONARQUBE_TOKEN}'
}
def pullRequestParams = params.REVIEWBOARD_REVIEW_ID != '' ? '-Dsonar.pullrequest.key=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.branch=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.base=${REVIEWBOARD_REVIEW_BRANCH}' : '-Dsonar.branch.name=${REVIEWBOARD_REVIEW_BRANCH}'
sh "./gradlew sonar -Dsonar.plugins.downloadOnlyRequired=false -Dsonar.scanner.metadataFilePath=${WORKSPACE}/tmp/sonar-metadata.txt -Dsonar.projectName=AusweisApp-SDKWrapper-Android ${pullRequestParams} -Dsonar.token=${SONARQUBE_TOKEN} -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=90"
}
}
}
stage('Package') {
steps {
sh './gradlew assemble'
sh "./gradlew -Dmaven.repo.local=${WORKSPACE}/dist publishReleasePublicationToMavenLocal"
}
}
stage('Publish release') {
when { expression { params.publishRelease } }
stage('Publish snapshot') {
when { expression { params.publish.contains('snapshot') } }
steps {
sh './gradlew publishReleasePublicationToLocalRepository'
sh './gradlew publishSnapshotPublicationToNexusSnapshotRepository'
}
}
stage('Maven snapshot publish') {
when { expression { params.mavenPublishSnapshot } }
environment {
NEXUS_URL = 'https://repo.govkg.de/repository/ausweisapp-snapshots'
}
stage('Publish release') {
when { expression { params.publish.contains('release') } }
steps {
sh './gradlew publishSnapshotPublicationToNexusRepository'
sh './gradlew publishReleasePublicationToNexusReleaseRepository'
}
}
stage('Maven release publish') {
when { equals expected: 'maven', actual: params.aarSource }
environment {
NEXUS_URL = 'https://repo.govkg.de/repository/ausweisapp-releases'
stage('Publish Maven') {
when {
expression { params.publish.contains('central') }
equals expected: 'maven', actual: params.aarSource
}
steps {
sh './gradlew publishReleasePublicationToNexusRepository'
sh './gradlew publishReleasePublicationToCentralRepository'
}
}
stage('Tarball') {
Expand All @@ -138,6 +132,7 @@ pipeline {
steps {
archiveArtifacts artifacts: '**/outputs/apk/**/*.apk', allowEmptyArchive: true
archiveArtifacts artifacts: '**/outputs/aar/**/*.aar'
archiveArtifacts artifacts: 'dist/**/*', excludes: '**/*.xml', allowEmptyArchive: true
archiveArtifacts artifacts: 'build/tar/*.tgz'
}
}
Expand Down
29 changes: 25 additions & 4 deletions jenkins/Seed.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ branches.each { branch ->
predefinedProp('REVIEWBOARD_REVIEW_BRANCH', "${branch}")
predefinedProp('aarSource', "${branch}_Android_AAR")
predefinedProp('performSonarScan', "true")
predefinedProp('mavenPublishSnapshot', "true")
predefinedProp('publish', "snapshot")
}
}
}
Expand Down Expand Up @@ -146,6 +146,27 @@ job("SDKWrapper_Android_Release") {
parameters {
stringParam( 'changeset', '', 'Build given changeset (tag) as release' )
choiceParam( 'aarSource', ['maven', 'Release_Android_AAR'], 'Source of the AAR.')
reactiveChoice {
name ('actions')
description('Upload to maven central repository')
filterable(false)
choiceType('PT_CHECKBOX')
script {
groovyScript {
script {
script("if (aarSource.equals('maven')) { return ['release:selected', 'central'] } else { return ['release:selected', 'central:disabled'] }")
sandbox(true)
}
fallbackScript {
script("return ['SCRIPT ERROR:disabled']")
sandbox(true)
}
}
}
referencedParameters('aarSource')
randomName('')
filterLength(0)
}
}
wrappers {
preBuildCleanup() {
Expand All @@ -165,7 +186,7 @@ job("SDKWrapper_Android_Release") {
unstable('UNSTABLE')
}
parameters {
predefinedProp('publishRelease', 'true')
predefinedProp('publish', '$actions')
predefinedProp('REVIEWBOARD_REVIEW_BRANCH', '$changeset')
predefinedProp('aarSource', '$aarSource')
}
Expand All @@ -181,9 +202,9 @@ job("SDKWrapper_Android_Release") {
archiveArtifacts {
allowEmpty(false)
onlyIfSuccessful(true)
pattern('**/outputs/apk/**/*.apk')
pattern('**/outputs/aar/**/*.aar')
pattern('dist/**/*')
pattern('build/tar/*.tgz')
pattern('**/outputs/apk/**/*.apk')
}
}
}
Expand Down
78 changes: 51 additions & 27 deletions sdkwrapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'
apply plugin: "org.jmailen.kotlinter"
apply plugin: 'maven-publish'
apply plugin: 'signing'

android {
compileSdk 35
Expand Down Expand Up @@ -75,60 +76,83 @@ task sourceJar(type: Jar) {
}

afterEvaluate {
if (System.getenv("GPG_ID")) {
signing {
setProperty("signing.gnupg.keyName", System.getenv("GPG_ID")[-8..-1])
setProperty("signing.gnupg.passphrase", System.getenv("GPG_PSW"))
useGpgCmd()
sign publishing.publications
}
}
publishing {
repositories {
maven {
name = 'Local'
url "$project.rootDir/build/dist/libs"
name = 'NexusSnapshot'
credentials {
username System.getenv("NEXUS_USERNAME")
password System.getenv("NEXUS_PSW")
}
url = "https://repo.govkg.de/repository/ausweisapp-snapshots"
}
maven {
name = 'Nexus'
name = 'NexusRelease'
credentials {
username System.getenv("NEXUS_USERNAME")
password System.getenv("NEXUS_PSW")
}
url = System.getenv("NEXUS_URL")
url = "https://repo.govkg.de/repository/ausweisapp-releases"
}
maven {
name = 'Central'
credentials {
username System.getenv("CENTRAL_USERNAME")
password System.getenv("CENTRAL_PSW")
}
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
}
}
publications.all {
publication -> pom {
name = 'AusweisApp2 SDK Wrapper'
description = 'Convenient authentication SDK'
url = 'https://www.governikus.de'
licenses {
license {
name = 'EUPL-v1.2'
url = 'https://eupl.eu/1.2/en/'
}
}
developers {
developer {
email = '[email protected]'
organization = 'Governikus'
organizationUrl = 'https://www.governikus.de/'
timezone = 'Europe/Berlin'
}
}
scm {
url = 'https://github.com/Governikus/AusweisApp2Wrapper-Android'
}
}
}
publications {
snapshot(MavenPublication) {
from components.release

groupId = 'com.governikus.ausweisapp'
artifactId = 'sdkwrapper'
version = "${sdkwrapper_version}-SNAPSHOT"

artifact(sourceJar)

pom {
licenses {
license {
name = 'EUPL-v1.2'
url = 'https://eupl.eu/1.2/en/'
}
}
}
}
release(MavenPublication) {
from components.release
pom {
name = 'AusweisApp2 SDK Wrapper'
description = 'Convenient authentication SDK'
url = 'https://www.governikus.de'
}

groupId = 'com.governikus.ausweisapp'
artifactId = 'sdkwrapper'
version = sdkwrapper_version

artifact(sourceJar)

pom {
licenses {
license {
name = 'EUPL-v1.2'
url = 'https://eupl.eu/1.2/en/'
}
}
}
}
}
}
Expand Down
12 changes: 0 additions & 12 deletions sdkwrapper/src/main/AndroidManifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class NfcForegroundDispatcher(
return
}
isStarted = true
nfcAdapter.enableReaderMode(
nfcAdapter?.enableReaderMode(
activity,
{ tag: Tag ->
if (tag.techList.contains(nfcTechnology)) {
Expand All @@ -59,6 +59,6 @@ class NfcForegroundDispatcher(
return
}
isStarted = false
nfcAdapter.disableReaderMode(activity)
nfcAdapter?.disableReaderMode(activity)
}
}
Loading

0 comments on commit 69b3088

Please sign in to comment.