|
9 | 9 |
|
10 | 10 | // Apply the java plugin to add support for Java |
11 | 11 | apply plugin: 'java' |
| 12 | +apply plugin: 'eclipse' |
| 13 | +apply plugin: 'maven' |
| 14 | +apply plugin: 'maven-publish' |
| 15 | +apply plugin: 'com.jfrog.bintray' |
| 16 | +archivesBaseName = 'ShimmerDriverPC' |
| 17 | +group = 'com.shimmerresearch.pcdriver' |
| 18 | +//group = "myorg" |
12 | 19 | version = '1.0' |
| 20 | +buildscript { |
| 21 | + repositories { |
| 22 | + jcenter() |
| 23 | + } |
| 24 | + dependencies { |
| 25 | + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' |
| 26 | + } |
| 27 | +} |
13 | 28 |
|
14 | 29 | // In this section you declare where to find the dependencies of your project |
15 | 30 | repositories { |
@@ -54,6 +69,87 @@ task fatJar(type: Jar) { |
54 | 69 | with jar |
55 | 70 | } |
56 | 71 |
|
| 72 | + |
| 73 | + // custom tasks for creating source/javadoc jars |
| 74 | + task sourcesJar(type: Jar, dependsOn: classes) { |
| 75 | + classifier = 'sources' |
| 76 | + from sourceSets.main.allSource |
| 77 | + } |
| 78 | + |
| 79 | + task javadocJar(type: Jar, dependsOn: javadoc) { |
| 80 | + classifier = 'javadoc' |
| 81 | + from javadoc.destinationDir |
| 82 | + } |
| 83 | + |
| 84 | + // add javadoc/source jar tasks as artifacts |
| 85 | + artifacts { |
| 86 | + archives sourcesJar, javadocJar |
| 87 | + } |
| 88 | + |
| 89 | + publishing { |
| 90 | + publications { |
| 91 | + mavenJava(MavenPublication) { |
| 92 | + if (plugins.hasPlugin('war')) { |
| 93 | + from components.web |
| 94 | + } else { |
| 95 | + from components.java |
| 96 | + } |
| 97 | + |
| 98 | + artifact sourcesJar |
| 99 | + //artifact javadocJar |
| 100 | + } |
| 101 | + } |
| 102 | + } |
| 103 | + |
| 104 | + bintray { |
| 105 | + user = bintray_username //this usually comes from gradle.properties file in ~/.gradle |
| 106 | + key = bintray_api_key //this usually comes from gradle.properties file in ~/.gradle |
| 107 | + |
| 108 | +// configurations = ['deployables'] //When uploading configuration files |
| 109 | + // - OR - |
| 110 | + publications = ['mavenJava'] //When uploading Maven-based publication files |
| 111 | + // - AND/OR - |
| 112 | +// filesSpec { //When uploading any arbitrary files ('filesSpec' is a standard Gradle CopySpec) |
| 113 | +// from 'arbitrary-files' |
| 114 | +// into 'standalone_files/level1' |
| 115 | +// rename '(.+)\\.(.+)', '$1-suffix.$2' |
| 116 | +// } |
| 117 | + dryRun = false //Whether to run this as dry-run, without deploying |
| 118 | + publish = true //If version should be auto published after an upload |
| 119 | + pkg { |
| 120 | +// repo = 'myrepo' |
| 121 | + repo = 'testshimmer' |
| 122 | + name = 'shimmerdriverpc' |
| 123 | +// userOrg = 'myorg' //An optional organization name when the repo belongs to one of the user's orgs |
| 124 | + desc = 'this is the Shimmer Driver for PC' |
| 125 | + websiteUrl = 'https://github.com/bintray/bintray-examples' |
| 126 | + issueTrackerUrl = 'https://github.com/bintray/bintray-examples/issues' |
| 127 | + vcsUrl = 'https://github.com/JongChern/ShimmerTest' |
| 128 | + licenses = ['Apache-2.0'] |
| 129 | + labels = ['example', 'gradle', 'bintray'] |
| 130 | + publicDownloadNumbers = true |
| 131 | + attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes |
| 132 | + //Optional version descriptor |
| 133 | + version { |
| 134 | + name = project.version //Bintray logical version name |
| 135 | + desc = 'optional, version-specific description' |
| 136 | +// released = 'optional, date of the version release' //2 possible values: date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ' OR a java.util.Date instance |
| 137 | +// vcsTag = '1.3.0' |
| 138 | +// attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] //Optional version-level attributes |
| 139 | +// gpg { |
| 140 | +// sign = true //Determines whether to GPG sign the files. The default is false |
| 141 | +// passphrase = 'passphrase' //Optional. The passphrase for GPG signing' |
| 142 | +// } |
| 143 | + mavenCentralSync { |
| 144 | + sync = false //Optional (true by default). Determines whether to sync the version to Maven Central. |
| 145 | + user = 'userToken' //OSS user token |
| 146 | + password = 'paasword' //OSS user password |
| 147 | + close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually. |
| 148 | + } |
| 149 | + } |
| 150 | + } |
| 151 | + } |
| 152 | + |
57 | 153 | // In this section you declare the dependencies for your production and test code |
58 | 154 | dependencies { |
59 | 155 | // The production code uses the SLF4J logging API at compile time |
|
0 commit comments