Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
213 lines (171 sloc) 4.31 KB
plugins {
id 'java'
id 'eclipse'
id "maven"
id "maven-publish"
id 'net.saliman.cobertura' version '2.2.6'
id "com.jfrog.bintray" version "1.7"
id 'co.riiid.gradle' version '0.4.2'
id 'synapticloop.documentr' version '2.7.2'
id "synapticloop.copyrightr" version "1.1.1"
id 'com.github.ben-manes.versions' version '0.13.0'
id "synapticloop.projectFilestatistics" version "1.0.2"
}
group = 'synapticloop'
archivesBaseName = 'linode-api'
description = """An api for linode"""
version = '3.1.0'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
configurations {
generate
}
sourceSets {
generate {
java {
srcDir 'src/generate/java'
}
resources {
srcDir 'src/generate/resources'
}
output.resourcesDir = 'build/classes/generate'
output.classesDir = 'build/classes/generate'
compileClasspath += sourceSets.main.output
}
}
eclipse {
classpath {
plusConfigurations += [ configurations.generateCompile ]
}
}
task generateCompile(type: JavaCompile) {
source = sourceSets.generate.java.srcDirs
source += sourceSets.main.java.srcDirs
classpath = configurations.generateCompile
classpath += configurations.compile
destinationDir = file("build/classes/generate")
}
task generate(type: JavaExec) {
dependsOn "generateCompile"
main = "synapticloop.linode.Main"
classpath += configurations.generateRuntime
classpath += configurations.runtime
classpath += sourceSets.generate.output
classpath += sourceSets.main.output
}
task generateSlugs(type: JavaExec) {
dependsOn "generateCompile"
main = "synapticloop.linode.SlugMain"
classpath += configurations.generateRuntime
classpath += configurations.runtime
classpath += sourceSets.generate.output
classpath += sourceSets.main.output
}
dependencies {
runtime 'org.json:json:20160810'
runtime 'org.apache.httpcomponents:httpclient:4.5.2'
runtime 'org.slf4j:slf4j-api:1.7.21'
compile 'org.json:json:20160810'
compile 'org.apache.httpcomponents:httpclient:4.5.2'
compile 'org.slf4j:slf4j-api:1.7.21'
generateCompile 'synapticloop:templar:1.3.0'
generateCompile 'org.jsoup:jsoup:1.9.2'
generateRuntime 'synapticloop:templar:1.3.0'
generateRuntime 'org.jsoup:jsoup:1.9.2'
testCompile group: 'junit', name: 'junit', version:'4.12'
testCompile 'org.apache.logging.log4j:log4j-slf4j-impl:2.7'
testCompile 'org.apache.logging.log4j:log4j-core:2.7'
testRuntime group: 'junit', name: 'junit', version:'4.12'
testRuntime 'org.apache.logging.log4j:log4j-slf4j-impl:2.7'
testRuntime 'org.apache.logging.log4j:log4j-core:2.7'
}
copyrightr {
dryRun = false
}
projectFilestatistics {
// the files to include in the generation of the statistics
includes = [
"src/main/**/*.*",
"src/docs/**/*.*"
]
// the files to exlude from the generation
excludes = [
]
// the output directory for the generated statistics
outputDirectory = 'src/docs'
}
/*
* COBERTURA
*/
cobertura {
coverageFormats = [ 'html', 'xml']
}
test {
include '**/*Test.class'
maxParallelForks = 1
forkEvery = 50
}
/*
*
* Publish to bintray
*
*/
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api/'
def groovyApiUrl = 'http://groovy.codehaus.org/gapi/'
tasks.withType(Javadoc) {
options.links(javaApiUrl, groovyApiUrl)
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
publishing {
publications {
Synapticloop(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId 'synapticloop'
artifactId 'linode-api'
pom.withXml {
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'compile'
}
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_PASSWORD')
publications = [ 'Synapticloop' ]
publish = true
pkg {
repo = 'maven'
name = 'linode-api'
}
}
github {
owner = group
repo = archivesBaseName
if(System.getenv('GITHUB_TOKEN')) {
token = System.getenv('GITHUB_TOKEN')
}
tagName = version
name = version
assets = [
'build/libs/' + archivesBaseName + '-' + version + '.jar'
]
}
You can’t perform that action at this time.