Gradle tasks:
--recompile-scripts: Forces scripts to be recompiled while bypassing caching.--rerun-tasks: Forces Gradle to rerun all tasks and ignore any task optimizations.
| package com.besimplify.android.test.ui.login; | |
| import android.os.AsyncTask; | |
| import android.os.Bundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.text.Editable; | |
| import android.text.TextWatcher; | |
| import android.util.Patterns; | |
| import android.view.KeyEvent; | |
| import android.view.View; |
| import com.cloudbees.hudson.plugins.folder.AbstractFolder | |
| import hudson.model.AbstractItem | |
| import groovy.transform.Field | |
| def jobName = "Android-Verify" // jobName can be set to a Job or a Folder. If a folder, it will clean all jobs in that folder | |
| //jobName should be full job name from root if mutliple levels down(for example "Folder1/Folder2/Job") | |
| def resetBuildNumber = false // If this is true, the build number will be set back to 1 | |
| @Field def dryRun = false // If this is true, the job will run without deletion. | |
| @Field def cleanedJobsTotal = 0 | |
| @Field def keepDays = 0 // Days to keep. |
Gradle tasks:
--recompile-scripts: Forces scripts to be recompiled while bypassing caching.--rerun-tasks: Forces Gradle to rerun all tasks and ignore any task optimizations.| import java.io.Closeable; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.security.MessageDigest; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.util.zip.ZipEntry; | |
| import java.util.zip.ZipInputStream; | |
| import okio.BufferedSink; | |
| import okio.BufferedSource; |
| #!/usr/bin/env bash | |
| set -xeuo pipefail | |
| USER_NAME=$1 | |
| SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip" | |
| ANDROID_HOME="/home/${USER_NAME}/android-sdk" | |
| # Download Android SDK |
| FROM jenkins/jenkins:lts | |
| USER root # if we want to install via apt | |
| RUN apt-get update | |
| ## Install essential libs | |
| RUN apt-get install -y build-essential dh-autoreconf | |
| ## Install Node |
| // Define custom lint task, say customLintCheck and includes all lint tasks from module | |
| def customLintCheck = tasks.register("customLintCheck") { | |
| group "verification" // Add task to verification group. | |
| description "Run lint check for all" | |
| dependsOn gradle.includedBuild('productdetail').task(':productdetail:lintDebug') | |
| } | |
| // Make customLintCheck run along with :app:lintDebug | |
| subprojects { |
| class App: Application { | |
| override fun onCreate() { | |
| super.onCreate() | |
| StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder() | |
| .detectDiskReads() | |
| .detectDiskWrites() | |
| .detectNetwork() | |
| .penaltyDeath() | |
| .penaltyLog() | |
| .build()) |
Parse argument from shell command.
| /** A tree which logs important information for crash reporting. */ | |
| class CrashReportingTree extends Tree { | |
| @Override public boolean isLoggable(int priority, @Nullable String tag) { | |
| return priority >= INFO; | |
| } | |
| @Override protected void log(int priority, String tag, Throwable t, String message) { | |
| if (priority == Log.VERBOSE || priority == Log.DEBUG) { | |
| return; | |
| } |