Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

Commit 7e4ca5c

Browse files
Merge pull request #411 from eclipse/develop
Release 0.9.0
2 parents 84e6ef9 + 50ba700 commit 7e4ca5c

843 files changed

Lines changed: 63132 additions & 47044 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.build/spotless.eclipseformat.xml

Lines changed: 0 additions & 340 deletions
This file was deleted.

.build/spotless.license.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/********************************************************************************
1+
/* **************************************************************************************
22
* Copyright (c) $YEAR Calypso Networks Association https://www.calypsonet-asso.org/
33
*
4-
* See the NOTICE file(s) distributed with this work for additional information regarding copyright
5-
* ownership.
4+
* See the NOTICE file(s) distributed with this work for additional information
5+
* regarding copyright ownership.
66
*
7-
* This program and the accompanying materials are made available under the terms of the Eclipse
8-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0
7+
* This program and the accompanying materials are made available under the terms of the
8+
* Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0
99
*
1010
* SPDX-License-Identifier: EPL-2.0
11-
********************************************************************************/
11+
************************************************************************************** */

Jenkinsfile

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
#!groovy
2+
def keypleVersion
3+
pipeline {
4+
agent {
5+
kubernetes {
6+
label 'keyple-java'
7+
yaml javaBuilder('1')
8+
}
9+
}
10+
environment {
11+
uploadParams = "-PdoSign=true --info"
12+
forceBuild = false
13+
PROJECT_NAME = "keyple-java"
14+
PROJECT_BOT_NAME = "Eclipse Keyple Bot"
15+
}
16+
stages {
17+
stage('Import keyring'){
18+
when {
19+
expression { env.GIT_URL == 'https://github.com/eclipse/keyple-java.git' && env.CHANGE_ID == null }
20+
}
21+
steps{
22+
container('java-builder') {
23+
withCredentials([
24+
file(credentialsId: 'secret-subkeys.asc',
25+
variable: 'KEYRING')]) {
26+
sh 'ln -s /home/jenkins/agent/gradle.properties /home/jenkins/.gradle/gradle.properties'
27+
28+
/* Import GPG keyring with --batch and trust the keys non-interactively in a shell build step */
29+
sh 'gpg1 --batch --import "${KEYRING}"'
30+
sh 'gpg1 --list-secret-keys'
31+
sh 'gpg1 --list-keys'
32+
sh 'gpg1 --version'
33+
sh 'for fpr in $(gpg1 --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg1 --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
34+
sh 'ls -l /home/jenkins/.gnupg/'
35+
}
36+
configFileProvider(
37+
[configFile(fileId: 'gradle.properties',
38+
targetLocation: '/home/jenkins/agent/gradle.properties')]) {
39+
/* Read key Id in gradle.properties */
40+
sh 'head -1 /home/jenkins/.gradle/gradle.properties'
41+
}
42+
}
43+
}
44+
}
45+
stage('Prepare settings') {
46+
steps{
47+
container('java-builder') {
48+
script {
49+
keypleVersion = sh(script: 'grep version java/component/keyple-core/gradle.properties | cut -d= -f2 | tr -d "[:space:]"', returnStdout: true).trim()
50+
echo "Building version ${keypleVersion}"
51+
deploySnapshot = env.GIT_URL == 'https://github.com/eclipse/keyple-java.git' && env.GIT_BRANCH == "develop" && env.CHANGE_ID == null && keypleVersion ==~ /.*-SNAPSHOT$/
52+
deployRelease = env.GIT_URL == 'https://github.com/eclipse/keyple-java.git' && (env.GIT_BRANCH == "master" || env.GIT_BRANCH.startsWith('release-')) && env.CHANGE_ID == null && keypleVersion ==~ /\d+\.\d+.\d+$/
53+
}
54+
}
55+
}
56+
}
57+
stage('Keyple Java: Build and Test') {
58+
steps{
59+
container('java-builder') {
60+
sh './gradlew installAll --info'
61+
catchError(buildResult: 'UNSTABLE', message: 'There were failing tests.', stageResult: 'UNSTABLE') {
62+
sh './gradlew check --info'
63+
}
64+
junit allowEmptyResults: true, testResults: 'java/component/**/build/test-results/test/*.xml'
65+
66+
script {
67+
keypleVersion = sh(script: 'grep version java/component/keyple-core/gradle.properties | cut -d= -f2 | tr -d "[:space:]"', returnStdout: true).trim()
68+
echo "Building version ${keypleVersion}"
69+
}
70+
}
71+
}
72+
}
73+
stage('Keyple Android: Build and Test') {
74+
steps{
75+
container('java-builder') {
76+
dir('android') {
77+
sh './gradlew :keyple-plugin:keyple-plugin-android-nfc:installPlugin :keyple-plugin:keyple-plugin-android-nfc:check'
78+
sh './gradlew :keyple-plugin:keyple-plugin-android-omapi:installPlugin :keyple-plugin:keyple-plugin-android-omapi:check'
79+
junit allowEmptyResults: true, testResults: 'keyple-plugin/**/build/test-results/testDebugUnitTest/*.xml'
80+
}
81+
}
82+
}
83+
}
84+
stage('Keyple Examples: Build and Test') {
85+
steps{
86+
container('java-builder') {
87+
sh 'keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US" -keyalg RSA -keysize 2048 -validity 90'
88+
89+
sh "./gradlew -b java/example/calypso/remotese/build.gradle check -P keyple_version=${keypleVersion}"
90+
91+
dir('java/example/calypso/android/nfc/') {
92+
sh "./gradlew assembleDebug -P keyple_version=${keypleVersion}"
93+
}
94+
dir('java/example/calypso/android/omapi') {
95+
sh "./gradlew assembleDebug -P keyple_version=${keypleVersion}"
96+
}
97+
}
98+
}
99+
}
100+
stage('Keyple Java: Tag/Push') {
101+
when {
102+
expression { deployRelease }
103+
}
104+
steps{
105+
container('java-builder') {
106+
withCredentials([usernamePassword(credentialsId: 'github-bot', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
107+
sh """
108+
git config --global user.email "${PROJECT_NAME}-bot@eclipse.org"
109+
git config --global user.name "${PROJECT_BOT_NAME}"
110+
git tag '${keypleVersion}'
111+
git push 'https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/eclipse/keyple-java.git' refs/tags/${keypleVersion}
112+
"""
113+
}
114+
}
115+
}
116+
}
117+
stage('Keyple Java: Code Quality') {
118+
when {
119+
expression { deploySnapshot || deployRelease }
120+
}
121+
steps {
122+
catchError(buildResult: 'SUCCESS', message: 'Unable to log code quality to Sonar.', stageResult: 'FAILURE') {
123+
container('java-builder') {
124+
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONAR_LOGIN')]) {
125+
sh './gradlew codeQuality --info'
126+
}
127+
}
128+
}
129+
}
130+
}
131+
stage('Keyple Android: Code Quality') {
132+
when {
133+
expression { deploySnapshot || deployRelease }
134+
}
135+
steps {
136+
catchError(buildResult: 'SUCCESS', message: 'Unable to log code quality to Sonar.', stageResult: 'FAILURE') {
137+
container('java-builder') {
138+
dir('android') {
139+
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONAR_LOGIN')]) {
140+
sh './gradlew codeQuality'
141+
}
142+
}
143+
}
144+
}
145+
}
146+
}
147+
stage('Keyple Java: Upload artifacts to sonatype') {
148+
when {
149+
expression { deploySnapshot || deployRelease }
150+
}
151+
steps{
152+
container('java-builder') {
153+
configFileProvider(
154+
[configFile(fileId: 'gradle.properties',
155+
targetLocation: '/home/jenkins/agent/gradle.properties')]) {
156+
sh './gradlew :java:component:keyple-core:uploadArchives ${uploadParams}'
157+
sh './gradlew :java:component:keyple-calypso:uploadArchives ${uploadParams}'
158+
sh './gradlew :java:component:keyple-plugin:keyple-plugin-pcsc:uploadArchives ${uploadParams}'
159+
sh './gradlew :java:component:keyple-plugin:keyple-plugin-remotese:uploadArchives ${uploadParams}'
160+
sh './gradlew :java:component:keyple-plugin:keyple-plugin-stub:uploadArchives ${uploadParams}'
161+
sh './gradlew --stop'
162+
}
163+
}
164+
}
165+
}
166+
stage('Keyple Android: Upload artifacts to sonatype') {
167+
when {
168+
expression { deploySnapshot || deployRelease }
169+
}
170+
steps{
171+
container('java-builder') {
172+
configFileProvider(
173+
[configFile(fileId: 'gradle.properties',
174+
targetLocation: '/home/jenkins/agent/gradle.properties')]) {
175+
dir('android') {
176+
sh './gradlew :keyple-plugin:keyple-plugin-android-nfc:uploadArchives ${uploadParams} -P keyple_version=${keypleVersion}'
177+
sh './gradlew :keyple-plugin:keyple-plugin-android-omapi:uploadArchives ${uploadParams} -P keyple_version=${keypleVersion}'
178+
sh './gradlew --stop'
179+
}
180+
}
181+
}
182+
}
183+
}
184+
stage('Keyple Java: Prepare packaging') {
185+
when {
186+
expression { deploySnapshot || deployRelease }
187+
}
188+
steps {
189+
container('java-builder') {
190+
sh 'mkdir ./repository'
191+
sh 'mkdir ./repository/java'
192+
sh 'mkdir ./repository/android'
193+
sh 'cp ./java/component/keyple-calypso/build/libs/keyple-java-calypso*.jar ./repository/java'
194+
sh 'cp ./java/component/keyple-core/build/libs/keyple-java-core*.jar ./repository/java'
195+
sh 'cp ./java/component/keyple-plugin/pcsc/build/libs/keyple-java-plugin*.jar ./repository/java'
196+
sh 'cp ./java/component/keyple-plugin/remotese/build/libs/keyple-java-plugin*.jar ./repository/java'
197+
sh 'cp ./java/component/keyple-plugin/stub/build/libs/keyple-java-plugin*.jar ./repository/java'
198+
sh 'cp ./java/example/calypso/android/nfc/build/outputs/apk/debug/*.apk ./repository/android'
199+
sh 'cp ./java/example/calypso/android/omapi/build/outputs/apk/debug/*.apk ./repository/android'
200+
sh 'cp ./android/keyple-plugin/android-nfc/build/outputs/aar/keyple-android-plugin*.aar ./repository/android'
201+
sh 'cp ./android/keyple-plugin/android-omapi/build/outputs/aar/keyple-android-plugin*.aar ./repository/android'
202+
sh 'ls -R ./repository'
203+
}
204+
}
205+
}
206+
stage('Keyple Java: Deploy packaging to eclipse snapshots') {
207+
when {
208+
expression { deploySnapshot }
209+
}
210+
steps {
211+
container('java-builder') {
212+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
213+
sh "ssh genie.keyple@projects-storage.eclipse.org rm -rf /home/data/httpd/download.eclipse.org/keyple/snapshots"
214+
sh "ssh genie.keyple@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/keyple/snapshots"
215+
sh "scp -r ./repository/* genie.keyple@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/keyple/snapshots"
216+
}
217+
}
218+
}
219+
}
220+
stage('Keyple Java: Deploy packaging to eclipse releases') {
221+
when {
222+
expression { deployRelease }
223+
}
224+
steps {
225+
container('java-builder') {
226+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
227+
sh "ssh genie.keyple@projects-storage.eclipse.org rm -rf /home/data/httpd/download.eclipse.org/keyple/releases"
228+
sh "ssh genie.keyple@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/keyple/releases"
229+
sh "scp -r ./repository/* genie.keyple@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/keyple/releases"
230+
}
231+
}
232+
}
233+
}
234+
}
235+
post {
236+
always {
237+
container('java-builder') {
238+
archiveArtifacts artifacts: 'java/component/**/build/reports/tests/**,android/keyple-plugin/**/build/reports/tests/**', allowEmptyArchive: true
239+
}
240+
}
241+
}
242+
}

NOTICE.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ The project maintains the following source code repositories:
4444
* Olivier Delcroix - plugins Android, plugin Remote SE
4545
* Florent Clairambault - Keyple Core
4646
* Paulo Barreto - integration and demo
47+
* Meddy Menzikoff - Android plugins and Examples
4748

4849

4950
## Third-party Content
@@ -66,10 +67,30 @@ Junit (4.12)
6667

6768
####Specific for Android plugins
6869

69-
SEEK for Android (plugin OMAPI)
70+
SEEK for Android (plugin OMAPI) (3.2):
7071

7172
* License: Apache Software License, 2.0
7273

7374
Android Open Source Project
7475

7576
* License: Apache Software License, 2.0
77+
78+
Timber (4.7.1):
79+
80+
* Licence: Apache Software License, 2.0
81+
82+
slf4j Timber (3.1):
83+
84+
* Licence: Apache Software License, 2.0
85+
86+
Mockk (1.9):
87+
88+
* Licence: Apache Software License, 2.0
89+
90+
Kotlin Standard Library (1.3.50):
91+
92+
* Licence: Apache Software License, 2.0
93+
94+
Kotlinx Coroutines core (1.3.3):
95+
96+
* Licence: Apache Software License, 2.0

0 commit comments

Comments
 (0)