diff --git a/custom-jobs/current-jobs.json b/custom-jobs/current-jobs.json index eb10604..7678ba0 100644 --- a/custom-jobs/current-jobs.json +++ b/custom-jobs/current-jobs.json @@ -1,24 +1,25 @@ [ {"name": "Krita_Utilities_Setup", "pipeline": "krita/Krita_Utilities_Setup.pipeline", "cron": ""}, {"name": "Krita_Nightly_Appimage_Build", "pipeline": "krita/Krita_Nightly_Appimage_Build.pipeline", "cron": "@daily"}, + {"name": "Krita_Nightly_Android_Build", "pipeline": "krita/Krita_Nightly_Android_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Nightly_Windows_Build", "pipeline": "krita/Krita_Nightly_Windows_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Nightly_MacOS_Build", "pipeline": "krita/Krita_Nightly_MacOS_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Stable_Appimage_Build", "pipeline": "krita/Krita_Stable_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Stable_Windows_Build", "pipeline": "krita/Krita_Stable_Windows_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Nightly_Windows_Dependency_Build", "pipeline": "krita/Krita_Nightly_Windows_Dependency_Build.pipeline", "cron": ""}, {"name": "Krita_Nightly_Appimage_Dependency_Build", "pipeline": "krita/Krita_Nightly_Appimage_Dependency_Build.pipeline", "cron": ""}, {"name": "Krita_Nightly_MacOS_Dependency_Build", "pipeline": "krita/Krita_Nightly_MacOS_Dependency_Build.pipeline", "cron": ""}, {"name": "Krita_Nightly_Android_Dependency_Build", "pipeline": "krita/Krita_Nightly_Android_Dependency_Build.pipeline", "cron": ""}, {"name": "Krita_Release_Appimage_Build", "pipeline": "krita/Krita_Release_Appimage_Build.pipeline", "cron": ""}, {"name": "Krita_Release_Windows64_Build", "pipeline": "krita/Krita_Release_Windows64_Build.pipeline", "cron": ""}, {"name": "Krita_Release_Windows32_Build", "pipeline": "krita/Krita_Release_Windows32_Build.pipeline", "cron": ""}, {"name": "Krita_Release_Windows32_Dependency_Build", "pipeline": "krita/Krita_Release_Windows32_Dependency_Build.pipeline", "cron": ""}, {"name": "KMyMoney_Nightly_Appimage_Build", "pipeline": "kmymoney/KMyMoney_Nightly_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "KMyMoney_Nightly_Appimage_Dependency_Build", "pipeline": "kmymoney/KMyMoney_Nightly_Appimage_Dependency_Build.pipeline", "cron": ""}, {"name": "KMyMoney_Release_Appimage_Build", "pipeline": "kmymoney/KMyMoney_Release_Appimage_Build.pipeline", "cron": ""}, {"name": "KMyMoney_Stable_Appimage_Build", "pipeline": "kmymoney/KMyMoney_Stable_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "Kdenlive_Nightly_Appimage_Build", "pipeline": "kdenlive/Kdenlive_Nightly_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "Kdenlive_Nightly_Appimage_Dependency_Build", "pipeline": "kdenlive/Kdenlive_Nightly_Appimage_Dependency_Build.pipeline", "cron": ""} ] diff --git a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline b/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline new file mode 100644 index 0000000..ce63e5c --- /dev/null +++ b/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline @@ -0,0 +1,82 @@ +// Request a node to be allocated to us +node( "AndroidAArch64SDK" ) { +// We want Timestamps on everything +timestamps { + // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed + catchError { + + // First Thing: Checkout Sources + stage('Checkout Sources') { + // Make sure we have a clean slate to begin with + deleteDir() + + // Krita Code + checkout changelog: true, poll: true, scm: [ + $class: 'GitSCM', + branches: [[name: 'sh-zam/T10784-android-port']], + extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'krita/']], + userRemoteConfigs: [[url: 'https://anongit.kde.org/krita']] + ] + + } + + // Now retrieve the artifacts + stage('Retrieving Dependencies') { + // First we grab the artifacted dependencies built last time round + copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Nightly_Android_Dependency_Build' + + // Now we unpack them + sh """ + tar -xf $WORKSPACE/krita-android-deps.tar + """ + } + + // Make sure the Android SDK is setup properly + stage('Setting up SDK') { + // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail + sh """ + sdkmanager "platforms;android-28" + """ + } + + // Let's build Krita that we have everything we need + stage('Building Krita') { + // The first parameter to the script is where the scripts should work - which is our workspace in this case + // Otherwise we leave everything in the hands of that script + sh """ + unset QT_ANDROID + unset QMAKESPEC + + export ANDROID_ABI=arm64-v8a + export ANDROID_API_LEVEL=28 + export CMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT + + krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=krita + """ + } + + // Now we can generate the actual APKs! + stage('Generating Krita APK') { + // The scripts handle everything here, so just run them + sh """ + unset QT_ANDROID + unset QMAKESPEC + + export ANDROID_ABI=arm64-v8a + export ANDROID_API_LEVEL=28 + export CMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT + + krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=apk + + mv $WORKSPACE/build/krita_build_apk/build/outputs/apk/*/*.apk ./ + """ + } + + // Finally we capture the APKs for distribution to users + stage('Capturing APKs') { + // We use Jenkins artifacts for this to save having to setup additional infrastructure + archiveArtifacts artifacts: '*.apk', onlyIfSuccessful: true + } + } +} +}