Skip to content

Commit bad1fd3

Browse files
committed
Merge branch 'main' into feature/easy_way_for_custom_command
# Conflicts: # affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt
2 parents 60ad8ec + d4037f9 commit bad1fd3

File tree

9 files changed

+55
-12
lines changed

9 files changed

+55
-12
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,25 @@ In the example below, we're showing a hypothetical project graph and what projec
3939

4040
## Installation
4141

42+
```groovy
43+
// settings.gradle(.kts)
44+
pluginManagement {
45+
repositories {
46+
mavenCentral()
47+
gradlePluginPortal()
48+
}
49+
}
50+
51+
// root build.gradle(.kts)
52+
plugins {
53+
id("com.dropbox.affectedmoduledetector") version "<latest-version>"
54+
}
55+
```
56+
57+
Note that the plugin is currently published to Maven Central, so you need to add it to the repositories list in the `pluginsManagement` block.
58+
59+
Alternatively, it can be consumed via manual buildscript dependency + plugin application.
60+
4261
Apply the project to the root `build.gradle`:
4362
```groovy
4463
buildscript {

affectedmoduledetector/build.gradle

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,26 @@ plugins {
88
apply from: rootProject.file("gradle/jacoco.gradle")
99

1010
java {
11-
sourceCompatibility = JavaVersion.VERSION_1_7
12-
targetCompatibility = JavaVersion.VERSION_1_7
11+
sourceCompatibility = JavaVersion.VERSION_1_8
12+
targetCompatibility = JavaVersion.VERSION_1_8
1313
}
1414

1515
jacoco {
16-
toolVersion = "0.8.7"
16+
toolVersion = "0.8.8"
17+
}
18+
19+
gradlePlugin {
20+
plugins {
21+
affectedModuleDetectorPlugin {
22+
id = GROUP
23+
implementationClass = "com.dropbox.affectedmoduledetector.AffectedModuleDetectorPlugin"
24+
}
25+
}
1726
}
1827

1928
dependencies {
2029
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2130
testImplementation("junit:junit:4.13.2")
22-
testImplementation("com.nhaarman:mockito-kotlin:1.5.0")
23-
testImplementation("com.google.truth:truth:1.0.1")
31+
testImplementation("com.nhaarman:mockito-kotlin:1.6.0")
32+
testImplementation("com.google.truth:truth:1.1.3")
2433
}

affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTestConfiguration.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ open class AffectedTestConfiguration {
1010

1111
var assembleAndroidTestTask : String? = "assembleDebugAndroidTest"
1212
var runAndroidTestTask : String? = "connectedDebugAndroidTest"
13-
var jvmTestTask : String? = "testDebugUnitTest"
13+
var jvmTestTask : String? = DEFAULT_JVM_TEST_TASK
1414

1515
companion object {
1616
const val name = "affectedTestConfiguration"
17+
internal const val DEFAULT_JVM_TEST_TASK = "testDebugUnitTest"
1718
}
1819
}

affectedmoduledetector/src/main/resources/META-INF/gradle-plugins/com.dropbox.affectedmoduledetector.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = "1.6.10"
3+
ext.kotlin_version = "1.6.20"
44
repositories {
55
google()
66
mavenCentral()
@@ -9,11 +9,11 @@ buildscript {
99
}
1010
}
1111
dependencies {
12-
classpath "com.android.tools.build:gradle:7.1.2"
12+
classpath "com.android.tools.build:gradle:7.1.3"
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.2.0")
15-
classpath("org.jacoco:org.jacoco.core:0.8.7")
16-
classpath "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
14+
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.2.1")
15+
classpath("org.jacoco:org.jacoco.core:0.8.8")
16+
classpath "com.vanniktech:gradle-maven-publish-plugin:0.19.0"
1717
}
1818
}
1919

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
id("java-library")
3+
id("org.jetbrains.kotlin.jvm")
4+
}
5+
6+
java {
7+
sourceCompatibility = JavaVersion.VERSION_1_8
8+
targetCompatibility = JavaVersion.VERSION_1_8
9+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.dropbox.sample_jvm_module
2+
3+
class MyClass {
4+
}

sample/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include ':sample-app'
22
include ':sample-core'
3+
include ':sample-jvm-module'
34
include ':sample-util'

0 commit comments

Comments
 (0)