Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey authored Aug 5, 2018
2 parents b3d90cf + fd9361d commit 6b05621
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 69 deletions.
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
jobs:
build:
parallelism: 1
shell: /bin/bash --login
docker:
- image: circleci/android:api-28-alpha
environment:
TERM: xterm # Workaround for Gradle issues https://discuss.circleci.com/t/circleci-terminal-is-a-tty-but-term-is-not-set/9965/18
steps:
- checkout
- restore_cache:
keys:
# This branch if available
- v1-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v1-dep-
- run: ./gradlew dependencies
# Save dependency cache
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- ~/.m2
- ~/.gradle
- run: ./gradlew assembleDogfood test runTest
# Save test results
- store_test_results:
path: ./build/test-results
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ R.java
postcode.keystore
.gradle
build
.settings/
.idea/
.project
*.iml
local.properties
33 changes: 0 additions & 33 deletions .project

This file was deleted.

66 changes: 41 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.deploygate:gradle:0.6.2'
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.deploygate:gradle:1.1.5'
}
}
apply plugin: 'deploygate'
apply plugin: 'com.android.application'

File lp = project.rootProject.file('local.properties')
if (lp.exists()) {
Properties properties = new Properties()
properties.load(lp.newDataInputStream())
project.ext.set("sdkDir", properties.getProperty('sdk.dir'))
}
else {
project.ext.set("sdkDir", System.getenv("ANDROID_HOME"))
}

def gitSha() {
return 'git rev-parse --short HEAD'.execute().text.trim()
return 'git rev-parse --short HEAD'.execute().text.trim()
}
def gitLastCommit() {
return 'git log -1 --no-merges --pretty=oneline --abbrev-commit'.execute().text.trim()
return 'git log -1 --no-merges --pretty=oneline --abbrev-commit'.execute().text.trim()
}

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
compileSdkVersion 28
buildToolsVersion "28.0.1"

signingConfigs {
release {
Expand All @@ -36,34 +47,39 @@ android {
}
}

flavorDimensions "standard"

productFlavors {
production { }
dogfood {
versionName "DF-${gitSha()}"
buildToolsVersion "23.0.1"
}
}
production {
dimension "standard"
}
dogfood {
dimension "standard"
versionName "DF-${gitSha()}"
buildToolsVersion "28.0.1"
}
}

variantFilter { variant ->
if (variant.buildType.name.equals('release')
&& variant.getFlavors().get(0).name.equals('dogfood')) {
variant.setIgnore(true);
}
}
if (variant.buildType.name.equals('release')
&& variant.getFlavors().get(0).name.equals('dogfood')) {
variant.setIgnore(true);
}
}
}

deploygate {
userName = "palfrey"
token = System.getenv('DEPLOYGATE_KEY')
apks {
dogfood {
sourceFile = file("build/outputs/apk/postcode-dogfood-debug.apk")
}
}
userName = "palfrey"
token = System.getenv('DEPLOYGATE_KEY')
apks {
dogfood {
sourceFile = file("build/outputs/apk/postcode-dogfood-debug.apk")
}
}
}

task(runTest, dependsOn: 'assembleDogfood', type: JavaExec) {
main = 'net.tevp.postcode.PostcodeBackend'
classpath = files( 'build/intermediates/classes/dogfood/debug/', 'json.jar', System.getenv('ANDROID_HOME') + '/platforms/android-19/android.jar')
classpath = files( 'build/intermediates/classes/dogfood/debug/', 'json.jar', project.sdkDir + '/platforms/android-28/android.jar')
args '51.5269721','-0.0836098'
}
9 changes: 0 additions & 9 deletions circle.yml

This file was deleted.

4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Nov 21 22:03:59 GMT 2015
#Sun Aug 05 11:11:44 BST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip

0 comments on commit 6b05621

Please sign in to comment.