Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
secring.gpg
# Gradle files
.gradle/

# IntelliJ files
.idea/
*.iml

# Build files
build/
*.so
*.apk
BuildConfig.java
.DS_Store

# Local settings
local.properties

# Capture files
captures/

# Token file
libandroid/app/src/main/res/values/developer-config.xml
7 changes: 0 additions & 7 deletions libandroid/.gitignore

This file was deleted.

3 changes: 3 additions & 0 deletions libandroid/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ dependencies {
// Testing
testCompile 'junit:junit:4.12'
}

apply from: 'gradle-checkstyle.gradle'
apply from: 'gradle-config.gradle'
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
apply plugin: 'checkstyle'

checkstyle.toolVersion = '7.1'
checkstyle {
toolVersion = "7.1.1" // 7.3
configFile = "../../checkstyle.xml" as File
}

task checkstyle(type: Checkstyle) {
description 'Checks if the code adheres to coding standards'
group 'verification'

configFile = new File(rootDir, "checkstyle.xml")
configFile file("../../checkstyle.xml")
source 'src'
include '**/*.java'
exclude '**/gen/**'

classpath = files()
ignoreFailures = false
}
22 changes: 22 additions & 0 deletions libandroid/app/gradle-config.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// Configuration file for gradle build execution.
//

task accessToken {
def tokenFile = new File("app/src/main/res/values/developer-config.xml")
if (!tokenFile.exists()) {
String tokenFileContents = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<resources>\n" +
" <string name=\"mapbox_access_token\">" + "$System.env.MAPBOX_ACCESS_TOKEN" + "</string>\n" +
"</resources>"

if (tokenFileContents == null) {
throw new InvalidUserDataException("You must set the MAPBOX_ACCESS_TOKEN environment variable.")
}
tokenFile.write(tokenFileContents)
}
}

gradle.projectsEvaluated {
preBuild.dependsOn('accessToken')
}
2 changes: 2 additions & 0 deletions libandroid/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {

apply from: 'gradle-javadoc.gradle'
apply from: 'gradle-mvn-push.gradle'
apply from: 'gradle-checkstyle.gradle'

// See: https://github.com/chrisbanes/gradle-mvn-push/issues/43#issuecomment-84140513
afterEvaluate { project ->
Expand All @@ -56,3 +57,4 @@ afterEvaluate { project ->
}
}
}

17 changes: 17 additions & 0 deletions libandroid/lib/gradle-checkstyle.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apply plugin: 'checkstyle'

checkstyle {
toolVersion = "7.1.1" // 7.3
configFile = "../../checkstyle.xml" as File
}

task checkstyle(type: Checkstyle) {
description 'Checks if the code adheres to coding standards'
group 'verification'
configFile file("../../checkstyle.xml")
source 'src'
include '**/*.java'
exclude '**/gen/**'
classpath = files()
ignoreFailures = false
}
8 changes: 0 additions & 8 deletions libjava/.gitignore

This file was deleted.

4 changes: 1 addition & 3 deletions libjava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}

apply from: 'checkstyle.gradle'
}
1 change: 1 addition & 0 deletions libjava/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ def getGitRevision() {
}

apply from: 'gradle-mvn-push.gradle'
apply from: 'gradle-checkstyle.gradle'
17 changes: 17 additions & 0 deletions libjava/lib/gradle-checkstyle.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apply plugin: 'checkstyle'

checkstyle {
toolVersion = "7.1.1" // 7.3
configFile = "../../checkstyle.xml" as File
}

task checkstyle(type: Checkstyle) {
description 'Checks if the code adheres to coding standards'
group 'verification'
configFile file("../../checkstyle.xml")
source 'src'
include '**/*.java'
exclude '**/gen/**'
classpath = files()
ignoreFailures = false
}
Loading