152 lines
4.2 KiB
Groovy
152 lines
4.2 KiB
Groovy
buildscript {
|
|
repositories {
|
|
jcenter()
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.2'
|
|
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.8'
|
|
classpath 'io.spring.gradle:dependency-management-plugin:0.5.5.RELEASE'
|
|
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
|
|
classpath 'org.asciidoctor:asciidoctorj:1.5.2'
|
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
|
|
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0"
|
|
}
|
|
}
|
|
description = 'swagger2markup Build'
|
|
version = '0.9.3-SNAPSHOT'
|
|
group = 'io.github.robwin'
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'org.asciidoctor.convert'
|
|
apply plugin: 'jacoco'
|
|
apply plugin: 'com.github.kt3k.coveralls'
|
|
apply plugin: 'io.spring.dependency-management'
|
|
apply plugin: 'com.jfrog.bintray'
|
|
apply plugin: "com.jfrog.artifactory"
|
|
apply from: 'gradle/publishing.gradle'
|
|
|
|
tasks.withType(JavaCompile) {
|
|
sourceCompatibility = "1.7"
|
|
targetCompatibility = "1.7"
|
|
options.deprecation = true
|
|
options.encoding = 'UTF-8'
|
|
options.compilerArgs << "-Xlint:unchecked"
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url "https://oss.jfrog.org/artifactory/oss-snapshot-local"
|
|
}
|
|
jcenter()
|
|
mavenCentral()
|
|
mavenLocal()
|
|
}
|
|
|
|
dependencies {
|
|
compile 'io.github.robwin:markup-document-builder'
|
|
compile 'io.swagger:swagger-compat-spec-parser'
|
|
compile 'commons-collections:commons-collections'
|
|
compile 'commons-io:commons-io'
|
|
compile 'org.slf4j:slf4j-api'
|
|
testCompile 'junit:junit'
|
|
testCompile 'org.asciidoctor:asciidoctorj:1.5.2'
|
|
testCompile 'ch.qos.logback:logback-classic'
|
|
testCompile 'org.assertj:assertj-core'
|
|
}
|
|
|
|
dependencyManagement {
|
|
dependencies {
|
|
dependency "io.github.robwin:markup-document-builder:0.1.6-SNAPSHOT"
|
|
dependency "io.swagger:swagger-compat-spec-parser:1.0.16"
|
|
dependency "commons-collections:commons-collections:3.2.1"
|
|
dependency "commons-io:commons-io:2.4"
|
|
dependency "junit:junit:4.11"
|
|
dependency "org.slf4j:slf4j-api:1.7.12"
|
|
dependency "ch.qos.logback:logback-classic:1.1.2"
|
|
dependency "org.assertj:assertj-core:2.2.0"
|
|
}
|
|
}
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
classifier = 'javadoc'
|
|
from javadoc.destinationDir
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
|
|
ext {
|
|
generatedDocumentation = file('build/docs/asciidoc/generated')
|
|
}
|
|
|
|
asciidoctor {
|
|
sources {
|
|
include 'index.adoc'
|
|
}
|
|
backends = ['html5', 'pdf']
|
|
attributes = [
|
|
doctype: 'book',
|
|
toc: 'left',
|
|
toclevels: '2',
|
|
numbered: '',
|
|
sectlinks: '',
|
|
sectanchors: '',
|
|
hardbreaks: '',
|
|
generated: generatedDocumentation
|
|
]
|
|
}
|
|
|
|
artifactory {
|
|
contextUrl = 'https://oss.jfrog.org'
|
|
resolve {
|
|
repository {
|
|
repoKey = 'libs-release'
|
|
}
|
|
}
|
|
publish {
|
|
repository {
|
|
repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to
|
|
//when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
|
|
//~/.gradle/gradle.properties, otherwise to be set in the build server
|
|
username = project.hasProperty('bintrayUsername') ? project.bintrayUsername : System.getenv('BINTRAY_USER')
|
|
password = project.hasProperty('bintrayApiKey') ? project.bintrayApiKey : System.getenv('BINTRAY_KEY')
|
|
}
|
|
defaults {
|
|
publications('mavenJava')
|
|
}
|
|
}
|
|
if (System.properties['https.proxyHost']) {
|
|
clientConfig.proxy.host = System.properties['https.proxyHost']
|
|
clientConfig.proxy.port = System.properties['https.proxyPort'].toInteger()
|
|
}
|
|
|
|
}
|
|
|
|
jacocoTestReport {
|
|
reports {
|
|
xml.enabled = true // coveralls plugin depends on xml format report
|
|
html.enabled = true
|
|
}
|
|
}
|
|
|
|
tasks.coveralls {
|
|
dependsOn 'check'
|
|
}
|
|
|
|
tasks.artifactoryPublish {
|
|
dependsOn 'check'
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = '2.10'
|
|
}
|