apply plugin: 'groovy' apply plugin: 'maven' apply plugin: 'jbake' apply plugin: 'java' apply plugin: 'application' sourceCompatibility = 1.8 version = '0.1.1' group = 'com.perforce.workspace.tjuricek' mainClassName = "com.perforce.workshop.tjuricek.p4oauth.P4OAuth" ext { LOG4J='2.0-rc1' } buildscript { repositories { maven { url 'http://artifactory.bnr.perforce.com/artifactory/repos-p4oauth' } } dependencies { classpath('com.jfrog.bintray.gradle:gradle-bintray-plugin:0.3') } } repositories { maven { url 'http://artifactory.bnr.perforce.com/artifactory/repos-p4oauth' } } dependencies { compile("commons-io:commons-io:2.4") compile('com.esotericsoftware.yamlbeans:yamlbeans:1.06') compile('com.github.jknack:handlebars:1.3.1') compile('com.perforce:p4java:2013.2.788582') compile("com.fasterxml.jackson.core:jackson-databind:2.3.1") compile('org.apache.commons:commons-pool2:2.2') compile("org.apache.logging.log4j:log4j-api:${LOG4J}") compile("org.apache.logging.log4j:log4j-core:${LOG4J}") compile('org.eclipse.jetty:jetty-server:9.2.0.RC0') compile('org.slf4j:slf4j-nop:1.6.4') compile('org.webjars:bootstrap:3.1.1-1') } jar { archiveName = "p4oauth.jar" manifest { attributes 'Main-Class': mainClassName } doFirst { from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } } exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' } task wrapper(type: Wrapper) { gradleVersion = '1.11' } jbake { input = file('src/site') output = file("docs/site") } apply plugin: 'maven-publish' apply plugin: 'bintray' javadoc { failOnError = false } // custom tasks for creating source/javadoc jars task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } // add javadoc/source jar tasks as artifacts artifacts { archives sourcesJar, javadocJar } publishing { publications { mavenStuff(MavenPublication) { if (plugins.hasPlugin('war')) { from components.web } else { from components.java } artifact sourcesJar { classifier "sources" } artifact javadocJar { classifier "javadoc" } } } } if (hasProperty('bintrayUser') && hasProperty('bintrayKey')) { bintray { user = property('bintrayUser') key = property('bintrayKey') publications = ['mavenStuff'] pkg { repo = 'maven' name = 'p4oauth' desc = 'OAuth 2.0 Authentication System for Perforce applications' licenses = ['BSD'] labels = ['perforce', 'scm', 'oauth'] } // dryRun = dry // whether to run this as dry-run, without deploying } }