├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── cookiecutter.json └── {{ cookiecutter.repo_name }} ├── .gitignore ├── PULL_REQUEST_TEMPLATE.md ├── app ├── build.gradle └── src │ ├── main │ ├── AndroidManifest.xml │ ├── kotlin │ │ └── {{ cookiecutter.package_path }} │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable │ │ └── drawable.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── kotlin │ └── {{ cookiecutter.package_path }} │ └── Test.kt ├── build.gradle ├── circle.yml ├── environmentSetup.sh ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## :wrench: changes 2 | - 3 | 4 | ## :question: why? 5 | - 6 | 7 | ## :memo: other considerations or concerns 8 | - 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # android-template 2 | 3 | A [cookiecutter](https://github.com/audreyr/cookiecutter) :cookie: template for new Android projects at thoughtbot 4 | 5 | ## What's Included? 6 | 7 | - The latest version of [Gradle Build Tools](https://gradle.org/) :wrench: 8 | - The latest version of the [Android Support Library](https://developer.android.com/topic/libraries/support-library/index.html) :books: 9 | - Some of our favorite and most often used [dependencies](https://github.com/thoughtbot/android-template/blob/master/%7B%7B%20cookiecutter.repo_name%20%7D%7D/app/build.gradle#L30) :family: 10 | - Internet permission :earth_africa: 11 | - Configuration for [CircleCI](https://circleci.com) :large_blue_circle: 12 | 13 | ## Optional Dependencies 14 | - [RxJava](https://github.com/ReactiveX/RxJava) and [RxAndroid](https://github.com/ReactiveX/RxAndroid) :arrows_clockwise: 15 | - [Calligraphy](https://github.com/chrisjenx/Calligraphy)- Library for custom fonts :black_nib: (note: once there is backwards compatibility for Android O's full support of fonts, this can be :scissors:) 16 | 17 | ## Usage 18 | 19 | Install cookiecutter (via homebrew on mac): 20 | 21 | ```bash 22 | brew install cookiecutter 23 | ``` 24 | 25 | Run: 26 | 27 | ```bash 28 | cookiecutter gh:thoughtbot/android-template 29 | ``` 30 | 31 | You'll be prompted for various configuration options - see [`cookiecutter.json`](https://github.com/thoughtbot/android-template/blob/master/cookiecutter.json) for the full list. To accept the configuration option you see in brackets, simply hit enter 32 | 33 | ## License 34 | 35 | android-template is Copyright © 2016 thoughtbot. It is free software, and may be redistributed under the terms specified in the [LICENSE] file. 36 | 37 | [LICENSE]: LICENSE 38 | 39 | ## About thoughtbot 40 | 41 | ![thoughtbot](http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg) 42 | 43 | android-template is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc. 44 | 45 | We love open source software! See [our other projects][community]. We are [available for hire][hire]. 46 | 47 | [community]: https://thoughtbot.com/community?utm_source=github 48 | 49 | [hire]: https://thoughtbot.com?utm_source=github 50 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_name": "project name", 3 | "repo_name": "{{ cookiecutter.project_name | lower | replace(' ', '_') }}", 4 | "company_name": "thoughtbot", 5 | "package_name": "com.{{cookiecutter.company_name | lower }}.{{ cookiecutter.project_name | lower }}", 6 | "package_path": "{{ cookiecutter.package_name | replace('.', '/') }}", 7 | "use_rx": "yes", 8 | "use_custom_fonts": "yes", 9 | 10 | "_copy_without_render": [ 11 | "gradlew", 12 | "gradlew.bat", 13 | "gradle/wrapper/gradle-wrapper.jar" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/.gitignore: -------------------------------------------------------------------------------- 1 | ### Android ### 2 | # Built application files 3 | *.apk 4 | *.ap_ 5 | 6 | # Files for the Dalvik VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Log Files 24 | *.log 25 | ### Intellij ### 26 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 27 | 28 | *.iml 29 | build 30 | 31 | ## Directory-based project format: 32 | .idea/ 33 | 34 | ## File-based project format: 35 | *.ipr 36 | *.iws 37 | 38 | ## Plugin-specific files: 39 | 40 | # IntelliJ 41 | /out/ 42 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## :wrench: changes 2 | - 3 | 4 | ## :card_index: trello card 5 | - 6 | 7 | ## :speech_balloon: notes/comments 8 | - 9 | 10 | ## :camera: screenshot 11 | - n/a 12 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | android { 6 | compileSdkVersion 27 7 | buildToolsVersion "26.0.2" 8 | defaultConfig { 9 | applicationId "$application_id" 10 | minSdkVersion 19 11 | targetSdkVersion 27 12 | versionCode 1 13 | versionName "1.0" 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | 23 | lintOptions { 24 | abortOnError false 25 | } 26 | 27 | sourceSets { 28 | main.java.srcDirs += 'src/main/kotlin' 29 | test.java.srcDirs += 'src/test/kotlin' 30 | } 31 | } 32 | 33 | ext { 34 | supportLibraryVersion = '27.0.1' 35 | retrofitVersion = '2.1.0' 36 | } 37 | 38 | dependencies { 39 | compile fileTree(dir: 'libs', include: ['*.jar']) 40 | 41 | //kotlin 42 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 43 | compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" 44 | compile 'org.jetbrains.anko:anko-common:0.8.3' 45 | 46 | //android 47 | compile "com.android.support:appcompat-v7:${supportLibraryVersion}" 48 | compile "com.android.support:design:${supportLibraryVersion}" 49 | compile "com.android.support:recyclerview-v7:${supportLibraryVersion}" 50 | 51 | //unit tests 52 | testCompile 'junit:junit:4.12' 53 | testCompile 'org.robolectric:robolectric:3.0' 54 | testCompile 'org.mockito:mockito-core:2.7.5' 55 | testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" 56 | testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" 57 | testCompile "com.nhaarman:mockito-kotlin:1.3.0" 58 | 59 | //automation tests 60 | androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1' 61 | androidTestCompile 'com.android.support.test:runner:1.0.1' 62 | androidTestCompile "com.android.support:support-annotations:${supportLibraryVersion}" 63 | 64 | //networking 65 | compile "com.squareup.retrofit2:retrofit:$retrofitVersion" 66 | compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" 67 | {% if cookiecutter.use_rx == 'yes' -%} 68 | compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion" 69 | {%- endif %} 70 | compile 'com.squareup.okhttp3:logging-interceptor:3.5.0' 71 | 72 | //image caching and downloading 73 | compile 'com.squareup.picasso:picasso:2.5.2' 74 | 75 | {% if cookiecutter.use_rx == 'yes' -%} 76 | //rx 77 | compile 'io.reactivex:rxjava:1.1.6' 78 | compile 'io.reactivex:rxandroid:1.1.0' 79 | compile 'com.jakewharton.rxbinding:rxbinding-recyclerview-v7:0.4.0' 80 | {%- endif %} 81 | 82 | 83 | {% if cookiecutter.use_custom_fonts == 'yes' -%} 84 | //custom fonts 85 | compile 'uk.co.chrisjenx:calligraphy:2.1.0' 86 | {%- endif %} 87 | } 88 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/kotlin/{{ cookiecutter.package_path }}/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package {{ cookiecutter.package_name }} 2 | 3 | import android.support.v7.app.AppCompatActivity 4 | 5 | /* 6 | * This class is just a place holder so all the package directories are created. 7 | */ 8 | class MainActivity : AppCompatActivity() 9 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/drawable/drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thoughtbot/android-template/132e4b33df48ba161d11ee775078af4dabfb94ab/{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thoughtbot/android-template/132e4b33df48ba161d11ee775078af4dabfb94ab/{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thoughtbot/android-template/132e4b33df48ba161d11ee775078af4dabfb94ab/{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thoughtbot/android-template/132e4b33df48ba161d11ee775078af4dabfb94ab/{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thoughtbot/android-template/132e4b33df48ba161d11ee775078af4dabfb94ab/{{ cookiecutter.repo_name }}/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | 8 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | {{ cookiecutter.project_name }} 3 | 4 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/app/src/test/kotlin/{{ cookiecutter.package_path }}/Test.kt: -------------------------------------------------------------------------------- 1 | package {{ cookiecutter.package_name }} 2 | 3 | import android.support.v7.app.AppCompatActivity 4 | 5 | /* 6 | * This class is just a place holder so all the package directories are created. 7 | */ 8 | class Test() 9 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.1.51' 5 | repositories { 6 | jcenter() 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.0.0' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" 13 | 14 | // NOTE: Do not place your application dependencies here; 15 | // they belong in the individual module build.gradle files 16 | } 17 | } 18 | 19 | allprojects { 20 | repositories { 21 | jcenter() 22 | google() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/circle.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Build configuration for Circle CI 3 | # 4 | general: 5 | artifacts: 6 | - "app/build/outputs/apk" 7 | - "app/build/reports/tests" 8 | - "app/build/outputs/androidTest-results" 9 | 10 | machine: 11 | timezone: 12 | America/Los_Angeles 13 | java: 14 | version: oraclejdk8 15 | environment: 16 | ANDROID_HOME: /usr/local/android-sdk-linux 17 | 18 | dependencies: 19 | pre: 20 | - source environmentSetup.sh && get_android_sdk_25 21 | - mkdir -p $ANDROID_HOME"/licenses" 22 | - echo $ANDROID_SDK_LICENSE > $ANDROID_HOME"/licenses/android-sdk-license" 23 | override: 24 | - source environmentSetup.sh && copy_env_vars_to_gradle_properties 25 | # we are cheating because there is a problem with constraint layout ATM 26 | # see: https://code.google.com/p/android/issues/detail?id=212128 27 | - ./gradlew dependencies || true 28 | - ./gradlew clean assembleRelease -PdisablePreDex 29 | 30 | test: 31 | override: 32 | - ./gradlew testRelease 33 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/environmentSetup.sh: -------------------------------------------------------------------------------- 1 | # Environment Setup which is required for Circle CI 2 | 3 | function copy_env_vars_to_gradle_properties { 4 | GRADLE_PROPERTIES=$HOME"/.gradle/gradle.properties" 5 | export GRADLE_PROPERTIES 6 | 7 | if [ ! -f "$GRADLE_PROPERTIES" ]; then 8 | echo "Gradle Properties does not exist" 9 | 10 | echo "Creating Gradle Properties directory and file..." 11 | mkdir -p "$HOME/.gradle/" 12 | touch "$GRADLE_PROPERTIES" 13 | 14 | // echo "Writing API_CLIENT_ID to gradle.properties..." 15 | //echo "API_CLIENT_ID=$API_CLIENT_ID" >> "$GRADLE_PROPERTIES" 16 | fi 17 | } 18 | 19 | function affirmative_android_update { 20 | echo y | android update sdk --no-ui --all --filter "$1" 21 | } 22 | 23 | function get_android_sdk_25 { 24 | # fix the CircleCI path 25 | # export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH" 26 | 27 | DEPS="$ANDROID_HOME/installed-dependencies" 28 | 29 | if [ ! -e $DEPS ]; then 30 | echo Fetch and install Android SDK 25 31 | echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-25.0.2,android-25,extra-google-m2repository,extra-google-google_play_services,extra-android-m2repository,extra-android-support 32 | # create the folder so we won't do this again (this is soooo Apache Ant right here) 33 | touch $DEPS 34 | fi 35 | } 36 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/gradle.properties: -------------------------------------------------------------------------------- 1 | application_id = {{ cookiecutter.package_name }} 2 | 3 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thoughtbot/android-template/132e4b33df48ba161d11ee775078af4dabfb94ab/{{ cookiecutter.repo_name }}/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Aug 03 12:03:03 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /{{ cookiecutter.repo_name }}/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------