blob: e8f5ca4a0ad0d240539ddb4776a8b1433e815c54 [file] [log] [blame]
Alexander Afanasyev44cac2a2016-01-28 11:18:16 -08001buildscript {
2 repositories {
3 jcenter()
4 mavenCentral()
5 }
6}
7
8apply plugin: 'java'
9apply plugin: 'maven'
10apply plugin: 'signing'
11
12group = 'net.named-data.jndn-extra'
Alexander Afanasyev4b2c19e2018-07-24 17:58:39 -040013version = '1.0.2-SNAPSHOT'
Alexander Afanasyev44cac2a2016-01-28 11:18:16 -080014
15sourceCompatibility = JavaVersion.VERSION_1_7
16targetCompatibility = JavaVersion.VERSION_1_7
17compileJava.options.encoding = 'UTF-8'
18
19repositories {
20 jcenter()
21 mavenLocal()
22 mavenCentral()
23 maven {
24 url "https://oss.sonatype.org/content/repositories/snapshots/"
25 }
26}
27
28sourceSets {
29 integrationTest {
30 java {
31 compileClasspath += main.output + test.output
32 runtimeClasspath += main.output + test.output
33 srcDir file('src/integration-test/java')
34 }
35 }
36}
37
38configurations {
39 integrationTestCompile.extendsFrom testCompile
40 integrationTestRuntime.extendsFrom testRuntime
41}
42
43dependencies {
Alexander Afanasyev4b2c19e2018-07-24 17:58:39 -040044 compile 'com.google.guava:guava:25.1-jre'
45 compile 'net.named-data:jndn:0.17'
Alexander Afanasyev44cac2a2016-01-28 11:18:16 -080046
47 testCompile 'junit:junit:4.12'
Alexander Afanasyev4b2c19e2018-07-24 17:58:39 -040048 testCompile 'net.named-data.jndn-extra:jndn-mock:1.1.1'
Alexander Afanasyev44cac2a2016-01-28 11:18:16 -080049}
50
51task javadocJar(type: Jar) {
52 classifier = 'javadoc'
53 from javadoc
54}
55
56task sourcesJar(type: Jar) {
57 classifier = 'sources'
58 from sourceSets.main.allSource
59}
60
61task integrationTest(type: Test) {
62 description 'Compile and run integration tests'
63 testClassesDir = sourceSets.integrationTest.output.classesDir
64 classpath = sourceSets.integrationTest.runtimeClasspath
65}
66
67tasks.withType(Test) {
68 reports.html.destination = file("${reporting.baseDir}/${name}")
69 testLogging {
70 events "passed", "skipped", "failed"
71 showStandardStreams = true
72 }
73 outputs.upToDateWhen { false }
74}
75
76if (JavaVersion.current().isJava8Compatible()) {
77 allprojects {
78 tasks.withType(Javadoc) {
79 options.addStringOption('Xdoclint:none', '-quiet')
80 }
81 }
82}
83
84artifacts {
85 archives javadocJar, sourcesJar
86}
87
88signing {
89 required { gradle.taskGraph.hasTask("uploadArchives") }
90 sign configurations.archives
91}
92
93uploadArchives {
94 repositories {
95 mavenDeployer {
96 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
97
98 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
99 try {
100 authentication(userName: ossrhUsername, password: ossrhPassword)
101 }
102 catch (Exception e) {
103 }
104 }
105
106 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
107 try {
108 authentication(userName: ossrhUsername, password: ossrhPassword)
109 }
110 catch (Exception e) {
111 }
112 }
113
114 pom.project {
115 name 'jndn-xx utilities'
116 packaging 'jar'
117 description 'Collection of tools to simplify synchronous and asynchronous data transfer over the NDN network'
118 url 'https://github.com/cawka/jndn-utils'
119
120 scm {
121 connection 'scm:git:https://github.com/cawka/jndn-utils'
122 developerConnection 'scm:git:https://github.com/cawka/jndn-utils'
123 url 'https://github.com/cawka/jndn-utils'
124 }
125
126 licenses {
127 license {
128 name 'GNU Lesser General Public License, Version 3.0+'
129 url 'http://www.gnu.org/licenses/lgpl.html'
130 }
131 }
132
133 developers {
134 developer {
135 id 'andrewbrown'
136 name 'Andrew Brown'
137 url 'https://github.com/andrewsbrown'
138 }
139 developer {
140 id 'cawka'
141 name 'Alexander Afanasyev'
142 email 'aa@cs.ucla.edu'
143 }
144 }
145 }
146 }
147 }
148}