Skip to content

Commit 6698806

Browse files
authored
Merge pull request #231 from ndtp/209-composite_build-3
Replace Plugin-Local with Composite Build
2 parents 2d95dd4 + d655231 commit 6698806

31 files changed

Lines changed: 121 additions & 111 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Testify Change Log
22

3+
## 3.2.0
4+
5+
- https://github.com/ndtp/android-testify/pull/231 - Replace Plugin-Local with Composite Build
6+
37
## 3.1.0
48

59
- https://github.com/ndtp/android-testify/pull/226 - Testify will now throw a `LowMemoryException` when attempts to allocate an `IntBuffer` fail. This can help users diagnose AVD configuration problems and reports on the state of the device.

Ext/Accessibility/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For more information about _Accessibility Checking_, please see https://develope
1818

1919
```groovy
2020
plugins {
21-
id("dev.testify") version "3.1.0" apply false
21+
id("dev.testify") version "3.2.0" apply false
2222
}
2323
```
2424

Ext/Accessibility/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ ext {
1818
]
1919
}
2020

21-
version = "$project.versions.testify"
21+
version = project.findProperty("testify_version") ?: "0.0.1-SNAPSHOT"
2222
group = pom.publishedGroupId
2323
archivesBaseName = pom.artifact
2424

2525
android {
2626
namespace "dev.testify.accessibility"
27-
compileSdkVersion coreVersions.compileSdk
2827

2928
lintOptions {
3029
abortOnError true
@@ -35,16 +34,17 @@ android {
3534
}
3635

3736
defaultConfig {
38-
minSdkVersion coreVersions.minSdk
39-
targetSdkVersion coreVersions.targetSdk
37+
compileSdk libs.versions.compileSdk.get().toInteger()
38+
minSdkVersion libs.versions.minSdk.get().toInteger()
39+
targetSdkVersion libs.versions.targetSdk.get().toInteger()
4040
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4141
multiDexEnabled = true
4242
kotlinOptions {
4343
allWarningsAsErrors = true
4444
}
4545
}
4646

47-
libraryVariants.all { variant ->
47+
libraryVariants.configureEach { variant ->
4848
variant.outputs.all {
4949
outputFileName = "${archivesBaseName}-${version}.aar"
5050
}

Ext/Compose/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Easily create screenshot tests for `@Composable` functions.
1212

1313
```groovy
1414
plugins {
15-
id("dev.testify") version "3.1.0" apply false
15+
id("dev.testify") version "3.2.0" apply false
1616
}
1717
```
1818

Ext/Compose/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ ext {
1818
]
1919
}
2020

21-
version = "$project.versions.testify"
21+
version = project.findProperty("testify_version") ?: "0.0.1-SNAPSHOT"
2222
group = pom.publishedGroupId
2323
archivesBaseName = pom.artifact
2424

2525
android {
2626
namespace "dev.testify.compose"
27-
compileSdkVersion coreVersions.compileSdk
2827

2928
lintOptions {
3029
abortOnError true
@@ -35,8 +34,9 @@ android {
3534
}
3635

3736
defaultConfig {
38-
minSdkVersion coreVersions.minSdk
39-
targetSdkVersion coreVersions.targetSdk
37+
compileSdk libs.versions.compileSdk.get().toInteger()
38+
minSdkVersion libs.versions.minSdk.get().toInteger()
39+
targetSdkVersion libs.versions.targetSdk.get().toInteger()
4040
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4141
multiDexEnabled = true
4242
kotlinOptions {

Ext/Fullscreen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can set a comparison tolerance using [ScreenshotRule.setExactness](../../Lib
2020

2121
```groovy
2222
plugins {
23-
id("dev.testify") version "3.1.0" apply false
23+
id("dev.testify") version "3.2.0" apply false
2424
}
2525
```
2626

Ext/Fullscreen/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ ext {
1818
]
1919
}
2020

21-
version = "$project.versions.testify"
21+
version = project.findProperty("testify_version") ?: "0.0.1-SNAPSHOT"
2222
group = pom.publishedGroupId
2323
archivesBaseName = pom.artifact
2424

2525
android {
2626
namespace "dev.testify.fullscreen"
27-
compileSdkVersion coreVersions.compileSdk
2827

2928
lintOptions {
3029
abortOnError true
@@ -35,8 +34,9 @@ android {
3534
}
3635

3736
defaultConfig {
38-
minSdkVersion coreVersions.minSdk
39-
targetSdkVersion coreVersions.targetSdk
37+
compileSdk libs.versions.compileSdk.get().toInteger()
38+
minSdkVersion libs.versions.minSdk.get().toInteger()
39+
targetSdkVersion libs.versions.targetSdk.get().toInteger()
4040
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4141
multiDexEnabled = true
4242
kotlinOptions {

Library/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ ext {
1919
]
2020
}
2121

22-
version = "$project.versions.testify"
22+
version = project.findProperty("testify_version") ?: "0.0.1-SNAPSHOT"
2323
group = pom.publishedGroupId
2424
archivesBaseName = pom.artifact
2525

2626
jacoco { toolVersion = "0.8.10" }
2727

2828
android {
29-
compileSdkVersion coreVersions.compileSdk
30-
3129
kotlinOptions {
3230
jvmTarget = '17'
3331
}
@@ -37,8 +35,9 @@ android {
3735
}
3836

3937
defaultConfig {
40-
minSdkVersion coreVersions.minSdk
41-
targetSdkVersion coreVersions.targetSdk
38+
compileSdk libs.versions.compileSdk.get().toInteger()
39+
minSdkVersion libs.versions.minSdk.get().toInteger()
40+
targetSdkVersion libs.versions.targetSdk.get().toInteger()
4241
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4342
multiDexEnabled = true
4443
kotlinOptions {
@@ -47,7 +46,7 @@ android {
4746
}
4847
}
4948

50-
libraryVariants.all { variant ->
49+
libraryVariants.configureEach { variant ->
5150
variant.outputs.all {
5251
outputFileName = "${archivesBaseName}-${version}.aar"
5352
}

Plugins/Gradle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To set a dependency reference to the Testify plugin:
1414

1515
```groovy
1616
plugins {
17-
id("dev.testify") version "3.1.0" apply false
17+
id("dev.testify") version "3.2.0" apply false
1818
}
1919
```
2020

Plugins/Gradle/build.gradle

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
33

44
plugins {
5+
id 'java-gradle-plugin'
56
id 'groovy'
6-
id 'kotlin'
7+
id 'org.jetbrains.kotlin.jvm'
78
id 'org.jetbrains.dokka'
89
id 'jacoco'
910
}
1011

12+
def gradleProperties = new Properties()
13+
file("../../gradle.properties").withInputStream { gradleProperties.load(it) }
14+
1115
ext {
1216
pom = [
1317
publishedGroupId : 'dev.testify',
@@ -22,11 +26,18 @@ ext {
2226
]
2327
}
2428

25-
version = "$project.versions.testify"
29+
version = gradleProperties.getProperty('testify_version')
2630
group = pom.publishedGroupId
27-
archivesBaseName = pom.artifact
2831

29-
sourceCompatibility = JavaVersion.VERSION_17
32+
gradlePlugin {
33+
automatedPublishing = false
34+
plugins {
35+
testifyPlugin {
36+
id = 'dev.testify'
37+
implementationClass = 'dev.testify.TestifyPlugin'
38+
}
39+
}
40+
}
3041

3142
test {
3243
jacoco {
@@ -72,27 +83,6 @@ jar {
7283
}
7384
}
7485

75-
tasks.register('configureLocal') {
76-
doFirst {
77-
version = "local"
78-
jar.manifest.attributes.put("Implementation-Version", version)
79-
}
80-
}
81-
82-
tasks.register('copyLocal', Copy) {
83-
from "$buildDir/libs/${project.name}-local.jar"
84-
into 'jar'
85-
}
86-
87-
tasks.register('assembleLocal') {
88-
dependsOn configureLocal
89-
dependsOn build
90-
dependsOn copyLocal
91-
92-
build.mustRunAfter configureLocal
93-
copyLocal.mustRunAfter build
94-
}
95-
9686
tasks.register('sourcesJar', Jar) {
9787
from sourceSets.main.groovy.srcDirs
9888
archiveClassifier = 'sources'

0 commit comments

Comments
 (0)