// All dependencies and any plugin definitions should be set up and cached via // artifactory. buildscript { repositories { maven { url 'http://artifactory.bnr.perforce.com/artifactory/repos-p4oauth' } } dependencies { classpath('com.perforce.workshop.tjuricek:perforce-gradle-plugin:0.1.2') classpath('com.jfrog.bintray.gradle:gradle-bintray-plugin:0.3') } } repositories { maven { url 'http://artifactory.bnr.perforce.com/artifactory/repos-p4oauth' } } // See http://www.gradle.org/docs/current/userguide/gradle_wrapper.html task wrapper(type: Wrapper) { gradleVersion = '1.11' } apply plugin: 'perforce' apply plugin: 'jbake' apply plugin: 'java' apply plugin: 'application' version = '0.1.1' group = 'com.perforce.workshop.tjuricek' mainClassName = 'com.perforce.initializer.Initializer' dependencies { compile('com.perforce.workshop.tjuricek:p4java_ext:0.1.0') compile('com.esotericsoftware.yamlbeans:yamlbeans:1.06') compile("com.fasterxml.jackson.core:jackson-databind:2.3.1") compile("com.github.spullara.mustache.java:compiler:0.8.12") compile('commons-io:commons-io:2.4') compile("org.apache.commons:commons-lang3:3.2.1") } jbake { input = file('src/site') output = file("$buildDir/site") } // A fat jar variation would be useful most likely for any non-java folks. //jar { // doFirst { // from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } // } // exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' // manifest { attributes 'Main-Class': mainClassName } //} apply plugin: 'maven' // Note: mostly for local dependencies only 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 = 'initializer' desc = 'Test data initialization system for Perforce server instances' licenses = ['BSD'] labels = ['perforce', 'scm', 'p4java'] } // dryRun = dry // whether to run this as dry-run, without deploying } }