From 62fd85e3aac2283ca6bc117f9e50881d0b4ba524 Mon Sep 17 00:00:00 2001 From: Governikus Date: Thu, 12 Sep 2024 15:45:27 +0200 Subject: [PATCH] Add revision: v2.2.1 --- AusweisApp2SDKWrapper/Package.swift | 2 +- AusweisApp2SDKWrapper/packaging/Package.swift | 2 +- jenkins/PipelineBuild.groovy | 93 +++++++++++++++---- ...ftPkg.groovy => Stage_CopySwiftPkg.groovy} | 4 +- .../StagePatch.groovy => Stage_Patch.groovy} | 4 +- jenkins/stages/StageCompileWrapper.groovy | 14 --- jenkins/stages/StagePackageXcframework.groovy | 23 ----- .../StageResolveSwiftPkgDependencies.groovy | 7 -- jenkins/stages/StageSonar.groovy | 8 -- jenkins/stages/StageStaticAnalysis.groovy | 5 - jenkins/stages/StageTest.groovy | 7 -- jenkins/stages/StageVerifyFormatting.groovy | 15 --- 12 files changed, 80 insertions(+), 104 deletions(-) rename jenkins/{stages/StageCopySwiftPkg.groovy => Stage_CopySwiftPkg.groovy} (89%) rename jenkins/{stages/StagePatch.groovy => Stage_Patch.groovy} (81%) delete mode 100644 jenkins/stages/StageCompileWrapper.groovy delete mode 100644 jenkins/stages/StagePackageXcframework.groovy delete mode 100644 jenkins/stages/StageResolveSwiftPkgDependencies.groovy delete mode 100644 jenkins/stages/StageSonar.groovy delete mode 100644 jenkins/stages/StageStaticAnalysis.groovy delete mode 100644 jenkins/stages/StageTest.groovy delete mode 100644 jenkins/stages/StageVerifyFormatting.groovy diff --git a/AusweisApp2SDKWrapper/Package.swift b/AusweisApp2SDKWrapper/Package.swift index ca2bca5..1f8e590 100644 --- a/AusweisApp2SDKWrapper/Package.swift +++ b/AusweisApp2SDKWrapper/Package.swift @@ -17,7 +17,7 @@ let package = Package( .package( name: "AusweisApp2", url: "https://github.com/Governikus/AusweisApp2-SDK-iOS", - .exact("2.2.0") + .exact("2.2.1") ) ], targets: [ diff --git a/AusweisApp2SDKWrapper/packaging/Package.swift b/AusweisApp2SDKWrapper/packaging/Package.swift index 4b68183..1ceec07 100644 --- a/AusweisApp2SDKWrapper/packaging/Package.swift +++ b/AusweisApp2SDKWrapper/packaging/Package.swift @@ -13,7 +13,7 @@ let package = Package( .package( name: "AusweisApp2", url: "https://github.com/Governikus/AusweisApp2-SDK-iOS", - .exact("2.2.0") + .exact("2.2.1") ) ], targets: [ diff --git a/jenkins/PipelineBuild.groovy b/jenkins/PipelineBuild.groovy index 83e84e6..b9f3c60 100644 --- a/jenkins/PipelineBuild.groovy +++ b/jenkins/PipelineBuild.groovy @@ -22,6 +22,14 @@ pipeline { timeout(time: 30, unit: 'MINUTES') } stages { + stage('Cleanup') { + steps { + cleanWs( + deleteDirs: true, + disableDeferredWipeout: true + ) + } + } stage('Checkout') { steps { script { @@ -39,20 +47,27 @@ pipeline { stage('Patch') { when { expression { params.REVIEWBOARD_REVIEW_ID != '' } } steps { - executeParameterLessStageScript('StagePatch') + script { + def executor = load 'jenkins/Stage_Patch.groovy' + executor() + } } } stage('Static analysis') { steps { - executeParameterLessStageScript('StageStaticAnalysis') + script { + sh 'swiftlint --strict' + } } } stage('Sonar') { when { expression { params.performSonarScan } } steps { script { - def executor = load 'jenkins/stages/StageSonar.groovy' - executor(params.activateReviewBuildParams) + def pullRequestParams = params.activateReviewBuildParams ? '-Dsonar.pullrequest.key=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.branch=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.base=${REVIEWBOARD_REVIEW_BRANCH}' : '-Dsonar.branch.name=${REVIEWBOARD_REVIEW_BRANCH}' + catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') { + sh "sonar-scanner -Dsonar.scanner.metadataFilePath=\${WORKSPACE}/tmp/sonar-metadata.txt ${pullRequestParams} -Dsonar.token=\${SONARQUBE_TOKEN} -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=90" + } } } } @@ -60,34 +75,85 @@ pipeline { when { expression { params.spmSource != 'github' } } steps { script { - def executor = load 'jenkins/stages/StageCopySwiftPkg.groovy' + def executor = load 'jenkins/Stage_CopySwiftPkg.groovy' executor(params.spmSource) } } } stage('Resolve Swift Package dependencies') { steps { - executeParameterLessStageScript('StageResolveSwiftPkgDependencies') + script { + def derivedDataDir = 'ResolvedDerivedData' + sh "rm -rf ${derivedDataDir}; rm -rf AusweisApp2SDKWrapper/build/${derivedDataDir}" + sh "cd AusweisApp2SDKWrapper; xcodebuild -scheme AusweisApp2SDKWrapper -resolvePackageDependencies -derivedDataPath build/${derivedDataDir} -clonedSourcePackagesDirPath ../${derivedDataDir}" + } } } stage('Compile SDKWrapper') { steps { - executeParameterLessStageScript('StageCompileWrapper') + script { + def commonBuildPrefix = 'cd AusweisApp2SDKWrapper; xcodebuild archive -workspace SDKWrapper.xcworkspace -scheme AusweisApp2SDKWrapper' + def osNameBuildCmdStemMap = [ + "iphoneos" : "${commonBuildPrefix} -sdk iphoneos -destination \"platform=iOS,name=Any iOS Device\" -configuration MinSizeRel ARCHS='arm64'", + "iphonesimulator-arm64" : "${commonBuildPrefix} -sdk iphonesimulator -destination \"platform=iOS Simulator,name=Any iOS Simulator Device\" -configuration MinSizeRel ARCHS='arm64'", + "iphonesimulator-x86_64" : "${commonBuildPrefix} -sdk iphonesimulator -destination \"platform=iOS Simulator,name=Any iOS Simulator Device\" -configuration MinSizeRel ARCHS='x86_64'" + ] + + sh 'security unlock-keychain ${KEYCHAIN_CREDENTIALS} ${HOME}/Library/Keychains/login.keychain-db' + osNameBuildCmdStemMap.each{entry -> sh "rm -rf ${entry.key}; rm -rf AusweisApp2SDKWrapper/build/${entry.key}" } + osNameBuildCmdStemMap.each{osName, buildCmdStem -> sh "${buildCmdStem} -derivedDataPath build/${osName} -clonedSourcePackagesDirPath ../${osName} -archivePath build/AusweisApp2SDKWrapper-${osName}.xcarchive SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES" } + } } } stage('Test') { steps { - executeParameterLessStageScript('StageTest') + script { + def cacheDir = 'test' + sh "rm -rf ${cacheDir}; rm -rf AusweisApp2SDKWrapper/build/${cacheDir}" + sh "cd AusweisApp2SDKWrapper; xcodebuild test -scheme SDKWrapperTests -destination \"platform=iOS Simulator,name=iPhone 15\" -derivedDataPath build/${cacheDir} -clonedSourcePackagesDirPath ../${cacheDir}" + } } } stage('Package xcframework') { steps { - executeParameterLessStageScript('StagePackageXcframework') + script { + sh 'cd AusweisApp2SDKWrapper; mkdir -p build/AusweisApp2SDKWrapper-iphoneos.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules' + sh 'cd AusweisApp2SDKWrapper; cp -r build/iphoneos/Build/Intermediates.noindex/ArchiveIntermediates/AusweisApp2SDKWrapper/BuildProductsPath/MinSizeRel-iphoneos/AusweisApp2SDKWrapper.swiftmodule build/AusweisApp2SDKWrapper-iphoneos.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules/AusweisApp2SDKWrapper.swiftmodule' + + sh 'cd AusweisApp2SDKWrapper; cp -r build/AusweisApp2SDKWrapper-iphonesimulator-arm64.xcarchive build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive' + sh 'cd AusweisApp2SDKWrapper; lipo -create -output build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/AusweisApp2SDKWrapper build/AusweisApp2SDKWrapper-iphonesimulator-arm64.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/AusweisApp2SDKWrapper build/AusweisApp2SDKWrapper-iphonesimulator-x86_64.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/AusweisApp2SDKWrapper' + sh 'cd AusweisApp2SDKWrapper; mkdir -p build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules' + sh 'cd AusweisApp2SDKWrapper; cp -r build/iphonesimulator-arm64/Build/Intermediates.noindex/ArchiveIntermediates/AusweisApp2SDKWrapper/BuildProductsPath/MinSizeRel-iphonesimulator/AusweisApp2SDKWrapper.swiftmodule build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules/' + sh 'cd AusweisApp2SDKWrapper; cp -r build/iphonesimulator-x86_64/Build/Intermediates.noindex/ArchiveIntermediates/AusweisApp2SDKWrapper/BuildProductsPath/MinSizeRel-iphonesimulator/AusweisApp2SDKWrapper.swiftmodule build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules/' + + sh 'cd AusweisApp2SDKWrapper; xcodebuild -create-xcframework -framework build/AusweisApp2SDKWrapper-iphoneos.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework -framework build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework -output build/spm/AusweisApp2SDKWrapper.xcframework' + + sh 'cd AusweisApp2SDKWrapper; cp -r Sources/ build/spm' + sh 'cd AusweisApp2SDKWrapper; cp -r packaging/ build/spm' + + sh 'cd AusweisApp2SDKWrapper; mkdir -p build/dist' + sh 'cd AusweisApp2SDKWrapper/build/spm; zip -r ../dist/AusweisApp2SDKWrapper.xcframework.zip AusweisApp2SDKWrapper.xcframework Package.swift Sources' + sh 'cd AusweisApp2SDKWrapper/build; zip -r dist/AusweisApp2SDKWrapper-iphoneos.framework.dSYM.zip AusweisApp2SDKWrapper-iphoneos.xcarchive/dSYMs/AusweisApp2SDKWrapper.framework.dSYM' + sh 'cd AusweisApp2SDKWrapper/build; zip -r dist/AusweisApp2SDKWrapper-iphonesimulator-arm64.framework.dSYM.zip AusweisApp2SDKWrapper-iphonesimulator-arm64.xcarchive/dSYMs/AusweisApp2SDKWrapper.framework.dSYM' + sh 'cd AusweisApp2SDKWrapper/build; zip -r dist/AusweisApp2SDKWrapper-iphonesimulator-x86_64.framework.dSYM.zip AusweisApp2SDKWrapper-iphonesimulator-x86_64.xcarchive/dSYMs/AusweisApp2SDKWrapper.framework.dSYM' + } } } stage('Verify formatting') { steps { - executeParameterLessStageScript('StageVerifyFormatting') + script { + sh 'hg commit --addremove --secret -u jenkins -m review || exit 0' + sh 'swiftformat --indent tab --commas inline AusweisApp2SDKWrapper SDKWrapperTester' + sh('''\ + STATUS=$(hg status | wc -c | xargs) + if [ "$STATUS" != "0" ]; then + echo 'FORMATTING FAILED: Patch is not formatted' + hg diff + hg revert -a -C + exit 1 + fi + '''.stripIndent().trim()) + } } } } @@ -111,10 +177,3 @@ pipeline { } } } - -def executeParameterLessStageScript(String stageFilePath) { - script { - def executor = load "jenkins/stages/${stageFilePath}.groovy" - executor() - } -} \ No newline at end of file diff --git a/jenkins/stages/StageCopySwiftPkg.groovy b/jenkins/Stage_CopySwiftPkg.groovy similarity index 89% rename from jenkins/stages/StageCopySwiftPkg.groovy rename to jenkins/Stage_CopySwiftPkg.groovy index e17e455..2bbb475 100644 --- a/jenkins/stages/StageCopySwiftPkg.groovy +++ b/jenkins/Stage_CopySwiftPkg.groovy @@ -1,6 +1,4 @@ -def name = 'StageCopySwiftPkg' return { pSpmSource -> - echo "Entering ${name}" copyArtifacts( projectName: "${pSpmSource}", filter: '**/*.zip', @@ -11,4 +9,4 @@ return { pSpmSource -> sh 'cd AusweisApp2SDKWrapper; find . -type f -name \'Package.swift\' -exec sed -i "" -e "/url:/d" -e "s/\\.exact\\(.*\\)/path: \\"..\\/AA2SwiftPackage\\"/" {} \\;' sh 'find . -type f \\( -iname "*.zip" -not -iname "AusweisApp2SDKWrapper*.zip" -not -path "./shared_workspace/*" \\) -exec unzip -o -d AA2SwiftPackage {} \\;' } -} \ No newline at end of file +} diff --git a/jenkins/stages/StagePatch.groovy b/jenkins/Stage_Patch.groovy similarity index 81% rename from jenkins/stages/StagePatch.groovy rename to jenkins/Stage_Patch.groovy index e340f80..70955cc 100644 --- a/jenkins/stages/StagePatch.groovy +++ b/jenkins/Stage_Patch.groovy @@ -1,7 +1,5 @@ -def name = 'StagePatch' return { - echo "Entering ${name}" sh 'hg --config extensions.strip= strip -r "secret() or draft()" --no-backup --force || exit 0' publishReview downloadOnly: true, installRBTools: false sh "hg --config patch.eol=auto import --no-commit patch.diff" -} \ No newline at end of file +} diff --git a/jenkins/stages/StageCompileWrapper.groovy b/jenkins/stages/StageCompileWrapper.groovy deleted file mode 100644 index 60c19ce..0000000 --- a/jenkins/stages/StageCompileWrapper.groovy +++ /dev/null @@ -1,14 +0,0 @@ -def name = 'StageCompileWrapper' -def commonBuildPrefix = 'cd AusweisApp2SDKWrapper; xcodebuild archive -workspace SDKWrapper.xcworkspace -scheme AusweisApp2SDKWrapper' -def osNameBuildCmdStemMap = [ - "iphoneos" : "${commonBuildPrefix} -sdk iphoneos -destination \"platform=iOS,name=Any iOS Device\" -configuration MinSizeRel ARCHS='arm64'", - "iphonesimulator-arm64" : "${commonBuildPrefix} -sdk iphonesimulator -destination \"platform=iOS Simulator,name=Any iOS Simulator Device\" -configuration MinSizeRel ARCHS='arm64'", - "iphonesimulator-x86_64" : "${commonBuildPrefix} -sdk iphonesimulator -destination \"platform=iOS Simulator,name=Any iOS Simulator Device\" -configuration MinSizeRel ARCHS='x86_64'" -] - -return { - echo "Entering ${name}" - sh 'security unlock-keychain ${KEYCHAIN_CREDENTIALS} ${HOME}/Library/Keychains/login.keychain-db' - osNameBuildCmdStemMap.each{entry -> sh "rm -rf ${entry.key}; rm -rf AusweisApp2SDKWrapper/build/${entry.key}" } - osNameBuildCmdStemMap.each{osName, buildCmdStem -> sh "${buildCmdStem} -derivedDataPath build/${osName} -clonedSourcePackagesDirPath ../${osName} -archivePath build/AusweisApp2SDKWrapper-${osName}.xcarchive SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES" } -} \ No newline at end of file diff --git a/jenkins/stages/StagePackageXcframework.groovy b/jenkins/stages/StagePackageXcframework.groovy deleted file mode 100644 index 2c87466..0000000 --- a/jenkins/stages/StagePackageXcframework.groovy +++ /dev/null @@ -1,23 +0,0 @@ -def name = 'StagePackageXcframework' -return { - echo "Entering ${name}" - sh 'cd AusweisApp2SDKWrapper; mkdir -p build/AusweisApp2SDKWrapper-iphoneos.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules' - sh 'cd AusweisApp2SDKWrapper; cp -r build/iphoneos/Build/Intermediates.noindex/ArchiveIntermediates/AusweisApp2SDKWrapper/BuildProductsPath/MinSizeRel-iphoneos/AusweisApp2SDKWrapper.swiftmodule build/AusweisApp2SDKWrapper-iphoneos.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules/AusweisApp2SDKWrapper.swiftmodule' - - sh 'cd AusweisApp2SDKWrapper; cp -r build/AusweisApp2SDKWrapper-iphonesimulator-arm64.xcarchive build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive' - sh 'cd AusweisApp2SDKWrapper; lipo -create -output build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/AusweisApp2SDKWrapper build/AusweisApp2SDKWrapper-iphonesimulator-arm64.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/AusweisApp2SDKWrapper build/AusweisApp2SDKWrapper-iphonesimulator-x86_64.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/AusweisApp2SDKWrapper' - sh 'cd AusweisApp2SDKWrapper; mkdir -p build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules' - sh 'cd AusweisApp2SDKWrapper; cp -r build/iphonesimulator-arm64/Build/Intermediates.noindex/ArchiveIntermediates/AusweisApp2SDKWrapper/BuildProductsPath/MinSizeRel-iphonesimulator/AusweisApp2SDKWrapper.swiftmodule build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules/' - sh 'cd AusweisApp2SDKWrapper; cp -r build/iphonesimulator-x86_64/Build/Intermediates.noindex/ArchiveIntermediates/AusweisApp2SDKWrapper/BuildProductsPath/MinSizeRel-iphonesimulator/AusweisApp2SDKWrapper.swiftmodule build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework/Modules/' - - sh 'cd AusweisApp2SDKWrapper; xcodebuild -create-xcframework -framework build/AusweisApp2SDKWrapper-iphoneos.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework -framework build/AusweisApp2SDKWrapper-iphonesimulator.xcarchive/Products/Library/Frameworks/AusweisApp2SDKWrapper.framework -output build/spm/AusweisApp2SDKWrapper.xcframework' - - sh 'cd AusweisApp2SDKWrapper; cp -r Sources/ build/spm' - sh 'cd AusweisApp2SDKWrapper; cp -r packaging/ build/spm' - - sh 'cd AusweisApp2SDKWrapper; mkdir -p build/dist' - sh 'cd AusweisApp2SDKWrapper/build/spm; zip -r ../dist/AusweisApp2SDKWrapper.xcframework.zip AusweisApp2SDKWrapper.xcframework Package.swift Sources' - sh 'cd AusweisApp2SDKWrapper/build; zip -r dist/AusweisApp2SDKWrapper-iphoneos.framework.dSYM.zip AusweisApp2SDKWrapper-iphoneos.xcarchive/dSYMs/AusweisApp2SDKWrapper.framework.dSYM' - sh 'cd AusweisApp2SDKWrapper/build; zip -r dist/AusweisApp2SDKWrapper-iphonesimulator-arm64.framework.dSYM.zip AusweisApp2SDKWrapper-iphonesimulator-arm64.xcarchive/dSYMs/AusweisApp2SDKWrapper.framework.dSYM' - sh 'cd AusweisApp2SDKWrapper/build; zip -r dist/AusweisApp2SDKWrapper-iphonesimulator-x86_64.framework.dSYM.zip AusweisApp2SDKWrapper-iphonesimulator-x86_64.xcarchive/dSYMs/AusweisApp2SDKWrapper.framework.dSYM' -} \ No newline at end of file diff --git a/jenkins/stages/StageResolveSwiftPkgDependencies.groovy b/jenkins/stages/StageResolveSwiftPkgDependencies.groovy deleted file mode 100644 index 08e5a50..0000000 --- a/jenkins/stages/StageResolveSwiftPkgDependencies.groovy +++ /dev/null @@ -1,7 +0,0 @@ -def name = 'StageResolveSwiftPkgDependencies' -def derivedDataDir = 'ResolvedDerivedData' -return { - echo "Entering ${name}" - sh "rm -rf ${derivedDataDir}; rm -rf AusweisApp2SDKWrapper/build/${derivedDataDir}" - sh "cd AusweisApp2SDKWrapper; xcodebuild -scheme AusweisApp2SDKWrapper -resolvePackageDependencies -derivedDataPath build/${derivedDataDir} -clonedSourcePackagesDirPath ../${derivedDataDir}" -} \ No newline at end of file diff --git a/jenkins/stages/StageSonar.groovy b/jenkins/stages/StageSonar.groovy deleted file mode 100644 index 8113990..0000000 --- a/jenkins/stages/StageSonar.groovy +++ /dev/null @@ -1,8 +0,0 @@ -def name = 'StageSonar' -return { pIsReviewBuild -> - echo "Entering ${name}" - def pullRequestParams = pIsReviewBuild ? '-Dsonar.pullrequest.key=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.branch=${REVIEWBOARD_REVIEW_ID} -Dsonar.pullrequest.base=${MERCURIAL_REVISION_BRANCH}' : '-Dsonar.branch.name=${MERCURIAL_REVISION_BRANCH}' - catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') { - sh "sonar-scanner -Dsonar.scanner.metadataFilePath=\${WORKSPACE}/tmp/sonar-metadata.txt ${pullRequestParams} -Dsonar.token=\${SONARQUBE_TOKEN} -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=90" - } -} diff --git a/jenkins/stages/StageStaticAnalysis.groovy b/jenkins/stages/StageStaticAnalysis.groovy deleted file mode 100644 index 81d4b3c..0000000 --- a/jenkins/stages/StageStaticAnalysis.groovy +++ /dev/null @@ -1,5 +0,0 @@ -def name = 'StageStaticAnalysis' -return { - echo "Entering ${name}" - sh 'swiftlint --strict' -} \ No newline at end of file diff --git a/jenkins/stages/StageTest.groovy b/jenkins/stages/StageTest.groovy deleted file mode 100644 index 19094b8..0000000 --- a/jenkins/stages/StageTest.groovy +++ /dev/null @@ -1,7 +0,0 @@ -def name = 'StageTest' -def cacheDir = 'test' -return { - echo "Entering ${name}" - sh "rm -rf ${cacheDir}; rm -rf AusweisApp2SDKWrapper/build/${cacheDir}" - sh "cd AusweisApp2SDKWrapper; xcodebuild test -scheme SDKWrapperTests -destination \"platform=iOS Simulator,name=iPhone 15\" -derivedDataPath build/${cacheDir} -clonedSourcePackagesDirPath ../${cacheDir}" -} \ No newline at end of file diff --git a/jenkins/stages/StageVerifyFormatting.groovy b/jenkins/stages/StageVerifyFormatting.groovy deleted file mode 100644 index c75adc6..0000000 --- a/jenkins/stages/StageVerifyFormatting.groovy +++ /dev/null @@ -1,15 +0,0 @@ -def name = 'StageVerifyFormatting' -return { - echo "Entering ${name}" - sh 'hg commit --addremove --secret -u jenkins -m review || exit 0' - sh 'swiftformat --indent tab --commas inline AusweisApp2SDKWrapper SDKWrapperTester' - sh('''\ - STATUS=$(hg status | wc -c | xargs) - if [ "$STATUS" != "0" ]; then - echo 'FORMATTING FAILED: Patch is not formatted' - hg diff - hg revert -a -C - exit 1 - fi - '''.stripIndent().trim()) -} \ No newline at end of file