|
1 | | -version = "0.0.0-rc.1" |
2 | | - |
3 | | -gradle.projectsEvaluated { |
4 | | - tasks.withType(JavaCompile) { |
5 | | - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" |
6 | | - sourceCompatibility = "1.7" |
7 | | - targetCompatibility = "1.7" |
8 | | - } |
9 | | -} |
10 | | - |
11 | | -// Apply the java plugin to add support for Java |
12 | 1 | apply plugin: 'java' |
| 2 | +apply plugin: 'maven' |
13 | 3 |
|
14 | | -jar { |
15 | | - manifest { |
16 | | - attributes 'Implementation-Title': 'Persephony Java SDK', 'Implementation-Version': version |
17 | | - } |
18 | | -} |
| 4 | +group = 'com.github.PersephonyAPI' |
| 5 | + |
| 6 | +sourceCompatibility = 1.7 // java 7 |
| 7 | +targetCompatibility = 1.7 |
19 | 8 |
|
20 | | -// In this section you declare where to find the dependencies of your project |
21 | 9 | repositories { |
22 | | - mavenCentral(); |
| 10 | + mavenCentral() |
23 | 11 | } |
24 | 12 |
|
25 | | -// In this section you declare the dependencies for your production and test code |
26 | 13 | dependencies { |
27 | 14 | testCompile "org.mockito:mockito-core:2.6.8" |
28 | 15 | testCompile 'org.mock-server:mockserver-netty:3.10.4' |
29 | 16 | testCompile 'info.cukes:cucumber-java:1.2.4' |
30 | 17 | testCompile 'info.cukes:cucumber-junit:1.2.4' |
31 | 18 | testCompile 'junit:junit:4.12' |
32 | 19 |
|
33 | | - // The production code uses the SLF4J logging API at compile time |
34 | | - compile 'org.slf4j:slf4j-api:1.7.21' |
35 | 20 | compile 'com.google.code.gson:gson:2.6.2' |
36 | 21 | } |
37 | 22 |
|
| 23 | +task sourcesJar(type: Jar, dependsOn: classes) { |
| 24 | + classifier = 'sources' |
| 25 | + from sourceSets.main.allSource |
| 26 | +} |
| 27 | + |
| 28 | +task javadocJar(type: Jar, dependsOn: javadoc) { |
| 29 | + classifier = 'javadoc' |
| 30 | + from javadoc.destinationDir |
| 31 | +} |
| 32 | + |
38 | 33 | test { |
39 | 34 | testLogging.showStandardStreams = true |
40 | 35 | systemProperties System.getProperties() |
41 | 36 | } |
42 | 37 |
|
43 | | -uploadArchives { |
44 | | - repositories { |
45 | | - flatDir { |
46 | | - dirs 'repos' |
| 38 | +artifacts { |
| 39 | + archives sourcesJar |
| 40 | + archives javadocJar |
| 41 | +} |
| 42 | + |
| 43 | +// To specify a license in the pom: |
| 44 | +install { |
| 45 | + repositories.mavenInstaller { |
| 46 | + pom.project { |
| 47 | + licenses { |
| 48 | + license { |
| 49 | + name 'The Apache Software License, Version 2.0' |
| 50 | + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 51 | + distribution 'repo' |
| 52 | + } |
| 53 | + } |
47 | 54 | } |
48 | 55 | } |
49 | 56 | } |
| 57 | + |
0 commit comments