Skip to content

Commit

Permalink
Merge pull request #6 from wbrunette/upgrade-o-two
Browse files Browse the repository at this point in the history
clean up and update to latest android versions
  • Loading branch information
jbeorse authored Dec 11, 2017
2 parents 65489dc + 14030fc commit 618fd5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 98 deletions.
3 changes: 1 addition & 2 deletions remote.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
*
* This Gradle script handles dispatching various ODK Project buildscripts to where the common
* logic is stored.
*/

*/

// Remote Paths
def jacocoURL = 'https://raw.githubusercontent.com/opendatakit/gradle-config/' + gradle.ext.gradleConfigVersion + '/jacoco.gradle'
Expand Down
87 changes: 0 additions & 87 deletions runnables.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,98 +10,11 @@
*
* @TODO: Convert to custom Gradle plugin
*/

/**************************************************************************************************
METHODS
*************************************************************************************************/

// Check which test types (unit-test, androidtest) have been implemented
def listTests() {

def availiableTests = []
def testFolder = new File("${buildDir.parent}/src/test")
def androidTestFolder = new File("${buildDir.parent}/src/androidTest")

// Check unit-test location exists
if (testFolder.exists()) {
availiableTests.add("testDebugUnitTest")
}

// Check androidtest location exists
if (androidTestFolder.exists()) {
availiableTests.add("connectedDebugAndroidTest")
}

// Return a list of test types that have been implemented
return availiableTests
}

// List locations of available generated JaCoCo files
def listTestFiles() {

description = "Merge code coverage files from all available test types"

def testFiles = [];
def testFolder = new File("${buildDir.parent}/src/test")
def androidTestFolder = new File("${buildDir.parent}/src/androidTest")

// Check unit-test location exists
if (testFolder.exists()) {
testFiles.add("${buildDir}/jacoco/testDebugUnitTest.exec")
}

// Check androidtest location exists
if (androidTestFolder.exists()) {
testFiles.add("${buildDir}/outputs/code-coverage/connected/coverage.ec")
}

// Return list of file locations
return testFiles;
}

/**************************************************************************************************
TASKS
*************************************************************************************************/
// produces a composite code coverage report (vs. Android Studio's androidTest-only coverage)
task jacocoCoverageReport(type: JacocoReport) {

// combine the unit test and android test coverage files
executionData = files(listTestFiles())

// Include only relevant .class files
classDirectories = fileTree(
dir: "${buildDir}/intermediates/classes/debug",
excludes: ['**/R.class'
, '**/R$*.class'
, '**/BuildConfig.*'
, '**/*$ViewInjector*.*'
, '**/Manifest*.*'
, '**/*_*' // generated by androidannotaions
, '**/*InjectAdapter.class', '**/*ModuleAdapter*.class' // generated by dagger
, '**/database/provider/*' // generated database handling
]
)

sourceDirectories = files("${buildDir.parent}/src/main/java") // Set src directories

additionalSourceDirs = files([
"${buildDir}/generated/source/buildConfig/debug",
"${buildDir}/generated/source/r/debug"
])

// Set report output configuration
reports {
xml {
enabled = true
destination "${project.buildDir}/reports/jacoco/jacoco.xml"
}
html {
enabled = true
destination "${project.buildDir}/reports/jacoco"
}
}

}

// Define the snapshot version to be the git hash
task generateSnapshotVersion {
Expand Down
20 changes: 11 additions & 9 deletions variables.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ ext.versionCodeName = '2.0.2 rev ' + ext.releaseVersionCode + ext.inProgressVers
ext.masterArtifactVersion = 'rev216'

// SDK versions
ext.compileVersion = 26
ext.compileVersion = 27
ext.minVersion = 17
ext.targetVersion = 23

// Build tools
ext.buildTools = "27.0.1"
ext.buildTools = "27.0.2"

// Java version
ext.javaVersion = JavaVersion.VERSION_1_7
Expand Down Expand Up @@ -78,8 +78,6 @@ ext.masterDebug = gradle.ext.flavorMasterPrefix + gradle.ext.typeDebugSuffix
ext.snapshotRelease = gradle.ext.flavorSnapshotPrefix + gradle.ext.typeReleaseSuffix
ext.snapshotDebug = gradle.ext.flavorSnapshotPrefix + gradle.ext.typeDebugSuffix

ext.uitestRelease = gradle.ext.flavorUITestPrefix + gradle.ext.typeReleaseSuffix
ext.uitestDebug = gradle.ext.flavorUITestPrefix + gradle.ext.typeDebugSuffix

/**************************************************************************************************
TEST
Expand All @@ -104,6 +102,9 @@ ext.uitestMinSDK = 18
// Path from top-level Gradle script to local version of AndroidLibrary
ext.libraryProjectPath = new File(gradle.ext.workspacePath + "/androidlibrary/androidlibrary_lib")

// Path for subproject directory
ext.librarySubProjectDictory = new File('androidlibrary')

// Root project name
ext.libraryProjectRoot = ':androidlibrary'

Expand All @@ -128,6 +129,9 @@ ext.librarySnapshotArtifactName = gradle.ext.flavorSnapshotPrefix + gradle.ext.l
// Path from top-level Gradle script to local version of AndroidCommon
ext.commonProjectPath = new File(gradle.ext.workspacePath + "/androidcommon/androidcommon_lib")

// Path for subproject directory
ext.commonSubProjectDictory = new File('androidcommon')

// Root project name
ext.commonProjectRoot = ':androidcommon'

Expand All @@ -152,6 +156,9 @@ ext.commonSnapshotArtifactName = gradle.ext.flavorSnapshotPrefix + gradle.ext.co
// Path from top-level Gradle script to local version of SensorsInterface
ext.sensorsInterfaceProjectPath = new File(gradle.ext.workspacePath + "/sensorsinterface/sensorsinterface_lib")

// Path for subproject directory
ext.sensorsInterfaceSubProjectDictory = new File('sensorsinterface')

// Root project name
ext.sensorsInterfaceProjectRoot = ':sensorsinterface'

Expand Down Expand Up @@ -204,8 +211,3 @@ ext.tablesName = '.tables'

ext.sensorsFrameworkProjectChild = ':sensorsframework_app'
ext.sensorsFrameworkName = '.sensors'

/* -- Collect-- */

ext.collectProjectChild = ':collect_app'
ext.collectName = '.collect'

0 comments on commit 618fd5a

Please sign in to comment.