Skip to content

Commit 6a81863

Browse files
committed
Moved source from buildSrc to plugin folder + submodule tasks are no longer of the JacocoReport type.
1 parent 810ce7d commit 6a81863

File tree

18 files changed

+258
-74
lines changed

18 files changed

+258
-74
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
.externalNativeBuild
1212
.idea/
1313
*.exec
14+
repo/

app/build.gradle

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
43
apply plugin: 'jacoco'
54

65
android {
7-
compileSdkVersion 28
6+
compileSdkVersion versions.compileSdk
87
defaultConfig {
98
applicationId "org.neotech.app.multimoduleapplication"
10-
minSdkVersion 21
11-
targetSdkVersion 28
9+
minSdkVersion versions.minSdk
10+
targetSdkVersion versions.targetSdk
1211
versionCode 1
1312
versionName "1.0"
1413
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -25,12 +24,6 @@ android {
2524
}
2625
}
2726

28-
/*
29-
tasks.withType(Test) {
30-
jacoco.includeNoLocationClasses = true
31-
}
32-
*/
33-
3427
dependencies {
3528
implementation fileTree(dir: 'libs', include: ['*.jar'])
3629

build.gradle

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,37 @@ apply plugin: 'jacoco'
33
apply plugin: 'org.neotech.library.rootcoverage'
44

55
buildscript {
6+
ext.versions = [
7+
minSdk: 21,
8+
targetSdk: 28,
9+
compileSdk: 28,
10+
kotlin: "1.2.71",
11+
gradlePlugin: "3.1.4"
12+
]
613
ext.deps = [
7-
kotlinPlugin: 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71',
8-
gradlePlugin: 'com.android.tools.build:gradle:3.1.4',
9-
kotlinStdlibJdk7: 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71'
14+
kotlinPlugin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
15+
gradlePlugin: "com.android.tools.build:gradle:${versions.gradlePlugin}",
16+
kotlinStdlibJdk7: "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
1017
]
1118

1219
repositories {
1320
google()
1421
jcenter()
15-
//mavenCentral() //Jacoco is only on mavenCentral
22+
23+
// Local maven repository for development purposes.
24+
maven {
25+
url uri('/repo')
26+
}
1627
}
1728
dependencies {
1829
classpath deps.gradlePlugin
1930
classpath deps.kotlinPlugin
20-
// classpath "org.jacoco:org.jacoco.core:0.8.2"
2131

32+
// Bintray & Maven for publishing
33+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
34+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
35+
36+
classpath 'org.neotech.plugin:android-root-coverage-plugin:1.0.0-SNAPSHOT'
2237
// NOTE: Do not place your application dependencies here; they belong
2338
// in the individual module build.gradle files
2439
}
@@ -28,7 +43,6 @@ allprojects {
2843
repositories {
2944
google()
3045
jcenter()
31-
//mavenCentral()
3246
}
3347
}
3448

@@ -41,7 +55,6 @@ jacoco {
4155
toolVersion = "0.8.2"
4256
}
4357

44-
4558
rootCoverage {
4659
buildVariant "debug"
4760
//excludes ["**/library.a/**"]

buildSrc/build.gradle

Lines changed: 0 additions & 25 deletions
This file was deleted.

gradle.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,23 @@ org.gradle.jvmargs=-Xmx1536m
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1313
# org.gradle.parallel=true
1414

15+
GROUP=org.neotech.plugin
16+
VERSION_NAME=1.0.0-SNAPSHOT
17+
18+
BINTRAY_REPO=maven
19+
BINTRAY_LICENCE=Apache-2.0
20+
21+
POM_DESCRIPTION=A Gradle plugin for easy generation of combined code coverage reports for Android projects with multiple modules.
22+
23+
POM_URL=https://github.com/NeoTech-Software/android-root-coverage-plugin
24+
POM_SCM_URL=https://github.com/NeoTech-Software/android-root-coverage-plugin
25+
POM_SCM_CONNECTION=scm:git:git://github.com/NeoTech-Software/android-root-coverage-plugin.git
26+
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/NeoTech-Software/android-root-coverage-plugin.git
27+
28+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
29+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
30+
POM_LICENCE_DIST=repo
31+
32+
POM_DEVELOPER_ID=rolf-smit
33+
POM_DEVELOPER_NAME=Rolf Smit
34+
POM_DEVELOPER_EMAIL=[email protected]

java_module/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ dependencies {
44
implementation fileTree(dir: 'libs', include: ['*.jar'])
55
}
66

7-
sourceCompatibility = "7"
8-
targetCompatibility = "7"
7+
sourceCompatibility = JavaVersion.VERSION_1_8
8+
targetCompatibility = JavaVersion.VERSION_1_8

library_a/build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'jacoco'
44

55
android {
6-
compileSdkVersion 28
7-
6+
compileSdkVersion versions.compileSdk
87
defaultConfig {
9-
minSdkVersion 21
10-
targetSdkVersion 28
8+
minSdkVersion versions.minSdk
9+
targetSdkVersion versions.targetSdk
1110
versionCode 1
1211
versionName "1.0"
1312

1413
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1514
}
1615

16+
compileOptions {
17+
sourceCompatibility = JavaVersion.VERSION_1_8
18+
targetCompatibility = JavaVersion.VERSION_1_8
19+
}
20+
1721
buildTypes {
1822
debug {
1923
testCoverageEnabled true
@@ -24,11 +28,6 @@ android {
2428
}
2529
}
2630
}
27-
/*
28-
tasks.withType(Test) {
29-
jacoco.includeNoLocationClasses = true
30-
}
31-
*/
3231

3332
dependencies {
3433
implementation fileTree(dir: 'libs', include: ['*.jar'])

library_b/build.gradle

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'jacoco'
44

55
android {
6-
compileSdkVersion 28
7-
6+
compileSdkVersion versions.compileSdk
87
defaultConfig {
9-
minSdkVersion 21
10-
targetSdkVersion 28
8+
minSdkVersion versions.minSdk
9+
targetSdkVersion versions.targetSdk
1110
versionCode 1
1211
versionName "1.0"
1312

1413
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1514
}
1615

16+
compileOptions {
17+
sourceCompatibility = JavaVersion.VERSION_1_8
18+
targetCompatibility = JavaVersion.VERSION_1_8
19+
}
20+
1721
buildTypes {
1822
debug {
1923
testCoverageEnabled true
@@ -25,12 +29,6 @@ android {
2529
}
2630
}
2731

28-
/*
29-
tasks.withType(Test) {
30-
jacoco.includeNoLocationClasses = true
31-
}
32-
*/
33-
3432
dependencies {
3533
implementation fileTree(dir: 'libs', include: ['*.jar'])
3634

File renamed without changes.

plugin/build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apply plugin: 'java-gradle-plugin'
2+
apply plugin: 'kotlin'
3+
apply plugin: 'maven'
4+
5+
// To upload new artifact to maven:
6+
// > gradlew install
7+
// > gradlew bintrayUpload
8+
9+
//Without this line the Bintray upload will fail as it uses the module directory name as artifactId
10+
11+
sourceCompatibility = JavaVersion.VERSION_1_8
12+
targetCompatibility = JavaVersion.VERSION_1_8
13+
14+
dependencies {
15+
implementation gradleApi()
16+
implementation deps.kotlinPlugin
17+
implementation deps.gradlePlugin
18+
implementation deps.kotlinStdlibJdk7
19+
}
20+
21+
// For publishing to local maven repository for development purposes.
22+
uploadArchives {
23+
dependsOn install
24+
repositories {
25+
mavenDeployer {
26+
repository(url: uri('../repo'))
27+
}
28+
}
29+
}
30+
31+
// For publishing to external maven repository
32+
archivesBaseName = POM_ARTIFACT_ID
33+
group = GROUP
34+
version = VERSION_NAME
35+
apply from: rootProject.file('publish.gradle')

0 commit comments

Comments
 (0)