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