🚧 Gradle 6 - Platforms
This commit is contained in:
parent
f95a1a2011
commit
0c2d312186
2
gradle-6/.gitignore
vendored
2
gradle-6/.gitignore
vendored
@ -2,7 +2,7 @@
|
||||
# Gradle
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
build
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
@ -1,42 +1,5 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
group = "com.baeldung"
|
||||
version = "1.0.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api("io.reactivex.rxjava2:rxjava:2.2.16")
|
||||
implementation("com.google.guava:guava") {
|
||||
version {
|
||||
require("2.0")
|
||||
prefer("28.1-jre")
|
||||
because("Only uses ImmutableList type, so any version since 2.0 will do, but tested with 28.1-jre")
|
||||
}
|
||||
}
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.2")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.2")
|
||||
}
|
||||
|
||||
tasks.compileJava {
|
||||
sourceCompatibility = "1.8"
|
||||
targetCompatibility = "1.8"
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
register<MavenPublication>("mavenJava") {
|
||||
from(components["java"])
|
||||
}
|
||||
subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
29
gradle-6/dependency-constraints/build.gradle.kts
Normal file
29
gradle-6/dependency-constraints/build.gradle.kts
Normal file
@ -0,0 +1,29 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
}
|
||||
|
||||
group = "com.baeldung"
|
||||
version = "1.0.0"
|
||||
|
||||
dependencies {
|
||||
api("io.reactivex.rxjava2:rxjava:2.2.16")
|
||||
implementation("com.google.guava:guava") {
|
||||
version {
|
||||
require("10.0")
|
||||
prefer("28.1-jre")
|
||||
because("Only uses ImmutableList type, so any version since 2.0 will do, but tested with 28.1-jre")
|
||||
}
|
||||
}
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.2")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.2")
|
||||
}
|
||||
|
||||
tasks.compileJava {
|
||||
sourceCompatibility = "1.8"
|
||||
targetCompatibility = "1.8"
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
11
gradle-6/httpclient-platform/build.gradle.kts
Normal file
11
gradle-6/httpclient-platform/build.gradle.kts
Normal file
@ -0,0 +1,11 @@
|
||||
plugins {
|
||||
`java-platform`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
constraints {
|
||||
api("org.apache.httpcomponents:fluent-hc:4.5.10")
|
||||
api("org.apache.httpcomponents:httpclient:4.5.10")
|
||||
runtime("commons-logging:commons-logging:1.2")
|
||||
}
|
||||
}
|
12
gradle-6/module-metadata-publishing/build.gradle.kts
Normal file
12
gradle-6/module-metadata-publishing/build.gradle.kts
Normal file
@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
register<MavenPublication>("mavenJava") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
8
gradle-6/person-rest-client/build.gradle.kts
Normal file
8
gradle-6/person-rest-client/build.gradle.kts
Normal file
@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(platform(project(":httpclient-platform")))
|
||||
implementation("org.apache.httpcomponents:fluent-hc")
|
||||
}
|
@ -1 +1,7 @@
|
||||
rootProject.name = "gradle-6"
|
||||
|
||||
include("dependency-constraints")
|
||||
include("httpclient-platform")
|
||||
include("module-metadata-publishing")
|
||||
include("person-rest-client")
|
||||
include("widget-rest-client")
|
8
gradle-6/widget-rest-client/build.gradle.kts
Normal file
8
gradle-6/widget-rest-client/build.gradle.kts
Normal file
@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(platform(project(":httpclient-platform")))
|
||||
implementation("org.apache.httpcomponents:httpclient")
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user