Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Merge f2fae7a into e64ddaf
Browse files Browse the repository at this point in the history
  • Loading branch information
britter committed Dec 17, 2019
2 parents e64ddaf + f2fae7a commit 80f7e25
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,7 +1,7 @@
### https://raw.github.com/github/gitignore/f2ce448f2ba7a092da05482ceca99209127c0884/Gradle.gitignore

.gradle
/build/
build/

# Ignore Gradle GUI config
gradle-app.setting
Expand Down
119 changes: 4 additions & 115 deletions build.gradle.kts
Expand Up @@ -13,71 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.nio.charset.StandardCharsets

description = "Additional validator implementations for javax.validation"
group = "com.github.britter"
version = "0.6.4-SNAPSHOT"

plugins {
`java-library`
`java-test-fixtures`
jacoco
`maven-publish`
signing
id("de.marcphilipp.nexus-publish") version "0.3.0"
id("com.github.kt3k.coveralls") version "2.9.0"
id("org.asciidoctor.jvm.convert") version "2.4.0"
id("org.ajoberstar.git-publish") version "2.1.3"
`java-conventions`
`coveralls-conventions`
`documentation-conventions`
`publishing-conventions`
}

repositories {
mavenCentral()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}

tasks {
withType<JavaCompile> {
options.encoding = StandardCharsets.UTF_8.name()
}

javadoc {
exclude("**/internal/**")
}

val jacocoTestReport = named<JacocoReport>("jacocoTestReport") {
reports {
xml.isEnabled = true
}
}

coveralls {
jacocoReportPath = jacocoTestReport.map { it.reports.xml.destination }
}

asciidoctor {
outputOptions {
separateOutputDirs = false
}

attributes(mapOf(
"source-highlighter" to "coderay",
"tabsize" to "4",
"toc" to "left",
"icons" to "font",
"sectanchors" to true,
"idprefix" to "",
"idseparator" to "-"
))
}
}

dependencies {
api("javax.validation:validation-api:1.1.0.Final")
implementation("org.apache.commons:commons-lang3:3.6")
Expand All @@ -90,64 +40,3 @@ dependencies {
testFixturesApi("javax.el:javax.el-api:3.0.0")
testFixturesImplementation("com.google.guava:guava:23.0")
}

val asciidoctor by tasks.getting
val javadoc by tasks.getting
val testFixturesJavadoc by tasks.getting

gitPublish {
repoUri.set("https://github.com/britter/bean-validators")
branch.set("gh-pages")

contents {
from(asciidoctor)
from(javadoc) {
into("apidocs/main")
}
from(testFixturesJavadoc) {
into("apidocs/test-fixtures")
}
}
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])

pom {
description.set(project.description)
url.set("https://britter.github.io/bean-validators")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("britter")
name.set("Benedikt Ritter")
email.set("beneritter@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/britter/bean-validators.git")
developerConnection.set("scm:git:ssh://git@github.com/britter/bean-validators.git")
url.set("https://github.com/britter/bean-validators")
}
}
}
}
}

nexusPublishing {
repositories {
sonatype()
}
}

signing {
useGpgCmd()
sign(publishing.publications["maven"])
}
31 changes: 31 additions & 0 deletions buildSrc/build.gradle.kts
@@ -0,0 +1,31 @@
/*
* Copyright 2019 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
java
`kotlin-dsl`
`kotlin-dsl-precompiled-script-plugins`
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation("gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.9.0")
implementation("org.asciidoctor:asciidoctor-gradle-jvm:2.4.0")
implementation("org.ajoberstar:gradle-git-publish:2.1.3")
implementation("de.marcphilipp.gradle:nexus-publish-plugin:0.4.0")
}
Empty file added buildSrc/settings.gradle.kts
Empty file.
31 changes: 31 additions & 0 deletions buildSrc/src/main/kotlin/coveralls-conventions.gradle.kts
@@ -0,0 +1,31 @@
/*
* Copyright 2019 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
jacoco
id("com.github.kt3k.coveralls")
}

tasks {
val jacocoTestReport = named<JacocoReport>("jacocoTestReport") {
reports {
xml.isEnabled = true
}
}

coveralls {
jacocoReportPath = jacocoTestReport.map { it.reports.xml.destination }
}
}
60 changes: 60 additions & 0 deletions buildSrc/src/main/kotlin/documentation-conventions.gradle.kts
@@ -0,0 +1,60 @@
/*
* Copyright 2019 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("org.asciidoctor.jvm.convert")
id("org.ajoberstar.git-publish")
}

tasks {
named("javadoc", Javadoc::class) {
exclude("**/internal/**")
}

asciidoctor {
outputOptions {
separateOutputDirs = false
}

attributes(mapOf(
"source-highlighter" to "coderay",
"tabsize" to "4",
"toc" to "left",
"icons" to "font",
"sectanchors" to true,
"idprefix" to "",
"idseparator" to "-"
))
}
}

val asciidoctor by tasks.getting
val javadoc by tasks.getting
val testFixturesJavadoc by tasks.getting

gitPublish {
repoUri.set("https://github.com/britter/bean-validators")
branch.set("gh-pages")

contents {
from(asciidoctor)
from(javadoc) {
into("apidocs/main")
}
from(testFixturesJavadoc) {
into("apidocs/test-fixtures")
}
}
}
34 changes: 34 additions & 0 deletions buildSrc/src/main/kotlin/java-conventions.gradle.kts
@@ -0,0 +1,34 @@
/*
* Copyright 2019 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.nio.charset.StandardCharsets

plugins {
`java-library`
`java-test-fixtures`
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}

tasks {
withType<JavaCompile> {
options.encoding = StandardCharsets.UTF_8.name()
}
}
62 changes: 62 additions & 0 deletions buildSrc/src/main/kotlin/publishing-conventions.gradle.kts
@@ -0,0 +1,62 @@
/*
* Copyright 2019 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
`maven-publish`
signing
id("de.marcphilipp.nexus-publish")
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])

pom {
description.set(project.description)
url.set("https://britter.github.io/bean-validators")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("britter")
name.set("Benedikt Ritter")
email.set("beneritter@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/britter/bean-validators.git")
developerConnection.set("scm:git:ssh://git@github.com/britter/bean-validators.git")
url.set("https://github.com/britter/bean-validators")
}
}
}
}
}

nexusPublishing {
repositories {
sonatype()
}
}

signing {
useGpgCmd()
sign(publishing.publications["maven"])
}

0 comments on commit 80f7e25

Please sign in to comment.