Parse argument from shell command.
- $1: first argument
- ${1:-2}: first argument or fallback to 2
| # This is Git's per-user configuration file. | |
| [user] | |
| # Please adapt and uncomment the following lines: | |
| #. name = Giang Nguyen | |
| #. email = giang.nguyen@tiki.vn | |
| [alias] | |
| co = checkout | |
| st = status | |
| unstage = reset HEAD -- |
| // kotlin-gradle-plugin must be applied for configuration below to work | |
| // (see https://kotlinlang.org/docs/reference/using-gradle.html) | |
| repositories { | |
| jcenter() | |
| } | |
| configurations { | |
| ktlint | |
| } |
| /** 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; | |
| } |
Parse argument from shell command.
| class App: Application { | |
| override fun onCreate() { | |
| super.onCreate() | |
| StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder() | |
| .detectDiskReads() | |
| .detectDiskWrites() | |
| .detectNetwork() | |
| .penaltyDeath() | |
| .penaltyLog() | |
| .build()) |
| // 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 { |
| 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 |
| #!/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 |
| 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; |
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.