diff --git a/.gitignore b/.gitignore index 59abb83..bb8fb54 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,6 @@ /*.iml app/app.iml .ruby-version +.classpath +.project .settings -app/.settings diff --git a/Jenkinsfile b/Jenkinsfile index dda3eae..7985e2a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,7 +32,8 @@ $class: 'GitSCMSource', remote: libLazy.remote, credentialsId: libLazy.credentialsId - ]) + ]), + changelog: false, ) // Load Jenkins shared libraries to customize this project @@ -48,7 +49,8 @@ $class: 'GitSCMSource', remote: libCustom.remote, credentialsId: libCustom.credentialsId - ]) + ]), + changelog: false, ) // Define the remotes and the working and deploy branches @@ -67,10 +69,11 @@ JAVA_HOME: '/usr/java/latest', ANDROID_HOME: '/opt/android/sdk', GRADLE_USER_HOME: '/opt/android/gradle', - GRADLE_OPTS: '-XX:MaxMetaspaceSize=128m -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -Dme.jenkins', - GOOGLE_API_CID: 'dappre-google-api', + GRADLE_OPTS: '-XX:MaxMetaspaceSize=256m -Xmx1792m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -Dme.jenkins -Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process', + GOOGLE_API_CID: 'dappre-google-api', ], noIndex: '(.+_.+|production)', // Avoid automatic indexing for release and private branches + xmppTargets: 'noise@conference.qiy.nl', ) // Define lazyStages @@ -89,7 +92,7 @@ sh("git checkout ${lazyConfig['branch']}") }, run: { - fastLane('android', 'test', '', 'rh-ruby24') + fastLane('android', 'test', '', 'rh-ruby26') }, args: "-v /opt/android:/opt/android" + " -e JAVA_HOME=${env.JAVA_HOME}" @@ -108,7 +111,7 @@ currentBuild.displayName = "#${env.BUILD_NUMBER} ${currentVersion.string}-${currentVersion.number}" }, run: { - fastLane('android', 'build', '', 'rh-ruby24') + fastLane('android', 'build', '', 'rh-ruby26') }, args: "-v /opt/android:/opt/android" + " -v /opt/certificates:/opt/certificates" @@ -209,7 +212,10 @@ if ( !lazyConfig.env.DRYRUN ) { withCredentials([file(credentialsId: env.GOOGLE_API_CID, variable: 'GOOGLE_API_FILE')]) { sh('cp $GOOGLE_API_FILE ~/GoogleAPICredentials.json') - fastLane('android', 'beta', '', 'rh-ruby24') + def currentVersion = androidVersion() + withEnv(["VERSION=${currentVersion.string}-${currentVersion.number}"],) { + fastLane('android', 'beta', '', 'rh-ruby24') + } } } }, @@ -256,7 +262,10 @@ if ( !lazyConfig.env.DRYRUN ) { withCredentials([file(credentialsId: env.GOOGLE_API_CID, variable: 'GOOGLE_API_FILE')]) { sh('cp $GOOGLE_API_FILE ~/GoogleAPICredentials.json') - fastLane('android', 'production', '', 'rh-ruby24') + def currentVersion = androidVersion() + withEnv(["VERSION=${currentVersion.string}-${currentVersion.number}"],) { + fastLane('android', 'production', '', 'rh-ruby24') + } } } }, diff --git a/app/build.gradle b/app/build.gradle index 805ccd6..087f45d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,7 +42,7 @@ applicationId "nl.digital_me.dummyandroidapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.compileSdkVersion - versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 74 + versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 75 versionName project.hasProperty('versionName') ? project.property('versionName') : "0.0.5" multiDexEnabled true diff --git a/docker-compose.yml b/docker-compose.yml index aa08d07..95e5caa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,11 @@ resources: limits: cpus: '1.5' - memory: 1280M + memory: 2560M + environment: + - JAVA_HOME=/usr/java/latest + - ANDROID_HOME=/opt/android/sdk + - GRADLE_OPTS=-XX:MaxMetaspaceSize=256m -Xmx1792m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -Dme.jenkins -Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process networks: bridge: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index dfa59ee..b1bd5e6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -17,7 +17,7 @@ platform :android do - desc "Extract Application Id from gradle file" + # Extract Application Id from gradle file def get_application_id(flavor = nil, path = '../app/build.gradle', constant_name = 'applicationId') application_id = nil application_id_suffix = nil @@ -82,7 +82,7 @@ return "#{application_id}#{application_id_suffix}" end - desc "Define flavor name for deploy branch" + # Define flavor name for deploy branch def getFlavorName(options) flavor = nil if options and options[:fl_branch] and ! options[:fl_branch][/.*_.*/] @@ -104,22 +104,36 @@ return flavor end - desc "Define package name for a branch" + # Define package name for a branch def getPackageName(options = nil) return get_application_id(getFlavorName(options)) end + # Extract version_name from environment var named VERSION + def getVersionName(options = nil) + version_name = ENV['VERSION'] ? ENV['VERSION'].split('-')[0] : nil + return version_name + end + + # Extract version_code from environment var named VERSION + def getVersionCode(options = nil) + version_code = ENV['VERSION'] ? ENV['VERSION'].split('-')[1] : nil + return version_code + end + before_all do |lane, options| # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." end desc "Display infos about the app" lane :info do |options| + UI.message("App version name = #{getVersionName()}") + UI.message("App version number = #{getVersionCode()}") UI.message("App Flavor = #{getFlavorName(options)}") UI.message("App ID = #{getPackageName(options)}") end - desc "Runs all the tests" + desc "Run all the tests" lane :test do |options| gradle( task: "test", @@ -230,7 +244,6 @@ skip_upload_images: false, skip_upload_screenshots: false, package_name: "#{getPackageName(options)}", - version_code: lane_context[SharedValues::VERSION_CODE], ) end @@ -244,7 +257,7 @@ skip_upload_images: true, skip_upload_screenshots: true, package_name: "#{getPackageName(options)}", - version_code: lane_context[SharedValues::VERSION_CODE], + version_code: getVersionCode(), ) end @@ -258,7 +271,7 @@ skip_upload_images: true, skip_upload_screenshots: true, package_name: "#{getPackageName(options)}", - version_code: lane_context[SharedValues::VERSION_CODE], + version_code: getVersionCode(), ) end diff --git a/fastlane/metadata/android/en-US/changelogs/76.txt b/fastlane/metadata/android/en-US/changelogs/76.txt new file mode 100644 index 0000000..098b6f7 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/76.txt @@ -0,0 +1,3 @@ +- Nothing visible +- Backports from Dappre +- Improves PL \ No newline at end of file diff --git a/fastlane/metadata/android/nl-NL/changelogs/76.txt b/fastlane/metadata/android/nl-NL/changelogs/76.txt new file mode 100644 index 0000000..2ebc369 --- /dev/null +++ b/fastlane/metadata/android/nl-NL/changelogs/76.txt @@ -0,0 +1,3 @@ +- Niets zichtbaar +- Backports van Dappre +- Verbeterd PL \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 9ca4480..af40687 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,9 +26,15 @@ #-Duser.variant \ #-Dme.jenkins +#android.enableJetifier=true +#android.useAndroidX=true +#kotlin.incremental=true +#kapt.incremental.apt=true +#android.databinding.incremental=true +#android.enableR8=true # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects org.gradle.parallel=true -org.gradle.daemon=false +org.gradle.daemon=true org.gradle.caching=true diff --git a/lazyDir/centos7.Dockerfile b/lazyDir/centos7.Dockerfile index 7052f59..01fb1a7 100644 --- a/lazyDir/centos7.Dockerfile +++ b/lazyDir/centos7.Dockerfile @@ -43,16 +43,16 @@ which \ && yum -q clean all -# Install Ruby 2.4 from SCLO repo +# Install Ruby 2.6 from SCLO repo RUN yum -q clean expire-cache \ && yum -y install centos-release-scl scl-utils-build \ && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo \ && yum -y install \ - rh-ruby24-ruby \ - rh-ruby24-ruby-libs \ - rh-ruby24-ruby-devel \ - rh-ruby24-rubygems \ - rh-ruby24-rubygem-bundler \ + rh-ruby26-ruby \ + rh-ruby26-ruby-libs \ + rh-ruby26-ruby-devel \ + rh-ruby26-rubygems \ + rh-ruby26-rubygem-bundler \ && yum -q clean packages # Install extra dev tools @@ -76,10 +76,10 @@ # Create a symbolic link to latest JVM - for legacy scripts RUN mkdir /usr/java && ln -s /usr/lib/jvm/java-${jdk}-openjdk /usr/java/latest -# Enable Ruby 2.4 for any later bash session +# Enable Ruby 2.6 for any later bash session RUN echo "#!/bin/bash" > "/usr/local/bin/withruby" \ && echo "export PATH=\${PATH}:\${HOME}/bin" >> "/usr/local/bin/withruby" \ - && echo "source scl_source enable rh-ruby24" >> "/usr/local/bin/withruby" \ + && echo "source scl_source enable rh-ruby26" >> "/usr/local/bin/withruby" \ && echo 'exec "$@"' >> "/usr/local/bin/withruby" \ && chmod 0755 "/usr/local/bin/withruby" @@ -106,7 +106,7 @@ # Switch to non-root user and install requirements USER ${user} WORKDIR /home/${user} -RUN /usr/local/bin/withruby bundler install +RUN /usr/local/bin/withruby bundler install --path /home/${user}/.gems # Prepare locales (for Jekyll) ARG locale=en_US.UTF-8