apply plugin: 'groovy' // TODO remove dependency on local artifactory installation buildscript { repositories { maven { url 'http://artifactory.bnr.perforce.com/artifactory/repos-p4oauth' } jcenter() } dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.3' } } repositories { maven { url 'http://artifactory.bnr.perforce.com/artifactory/repos-p4oauth' } } group = "com.perforce.workshop.tjuricek" version = "0.1.1" // See http://www.gradle.org/docs/current/userguide/gradle_wrapper.html task wrapper(type: Wrapper) { gradleVersion = '1.11' } dependencies { compile gradleApi() compile localGroovy() } apply plugin: 'maven-publish' apply plugin: 'bintray' // 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" } } } } bintray { user = property('bintrayUser') key = property('bintrayKey') publications = ['mavenStuff'] pkg { repo = 'maven' name = 'perforce-gradle-plugin' desc = 'Adds startPerforce and stopPerforce commands to your gradle project' licenses = ['BSD'] labels = ['perforce', 'scm', 'gradle'] } // dryRun = dry // whether to run this as dry-run, without deploying }