Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 1 | buildscript { |
| 2 | repositories { |
| 3 | mavenLocal() |
| 4 | jcenter() |
| 5 | mavenCentral() |
| 6 | } |
| 7 | } |
| 8 | |
| 9 | plugins { |
Davide Pesavento | b6df513 | 2019-09-24 14:05:00 -0400 | [diff] [blame] | 10 | id 'java' |
| 11 | id 'maven' |
| 12 | id 'signing' |
| 13 | id 'checkstyle' |
Davide Pesavento | 399f0b9 | 2020-04-17 18:31:26 -0400 | [diff] [blame] | 14 | id 'org.sonarqube' version '2.8' |
| 15 | id 'net.saliman.cobertura' version '3.0.0' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 16 | } |
| 17 | |
Alexander Afanasyev | d2bb7af | 2018-07-24 19:18:32 -0400 | [diff] [blame] | 18 | group = 'net.named-data.jndn-extra' |
Alexander Afanasyev | 238bfc7 | 2020-05-18 21:49:47 -0400 | [diff] [blame^] | 19 | version = '1.3.0' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 20 | |
Alexander Afanasyev | d2bb7af | 2018-07-24 19:18:32 -0400 | [diff] [blame] | 21 | sourceCompatibility = JavaVersion.VERSION_1_8 |
| 22 | targetCompatibility = JavaVersion.VERSION_1_8 |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 23 | compileJava.options.encoding = 'UTF-8' |
| 24 | |
| 25 | repositories { |
| 26 | mavenLocal() |
| 27 | jcenter() |
| 28 | mavenCentral() |
| 29 | maven { |
Alexander Afanasyev | d2bb7af | 2018-07-24 19:18:32 -0400 | [diff] [blame] | 30 | url "https://oss.sonatype.org/content/repositories/releases/" |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 31 | } |
| 32 | } |
| 33 | |
| 34 | sourceSets { |
| 35 | test { |
| 36 | java { |
| 37 | exclude '**/*IT.java' |
| 38 | } |
| 39 | } |
| 40 | integrationTest { |
| 41 | java { |
| 42 | compileClasspath += main.output + test.output |
| 43 | runtimeClasspath += main.output + test.output |
| 44 | srcDir file('src/test/java') |
| 45 | include '**/*IT.java' |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | configurations { |
Alexander Afanasyev | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 51 | checkstyleConfig |
| 52 | integrationTestCompile.extendsFrom testCompile |
| 53 | integrationTestRuntime.extendsFrom testRuntime |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | dependencies { |
Alexander Afanasyev | 238bfc7 | 2020-05-18 21:49:47 -0400 | [diff] [blame^] | 57 | compile 'net.named-data:jndn:0.24' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 58 | |
| 59 | testCompile 'junit:junit:4.12' |
Alexander Afanasyev | 238bfc7 | 2020-05-18 21:49:47 -0400 | [diff] [blame^] | 60 | testCompile 'net.named-data.jndn-extra:jndn-mock:1.2.0' |
| 61 | testRuntime 'org.slf4j:slf4j-api:1.7.30' |
Alexander Afanasyev | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 62 | |
Davide Pesavento | b6df513 | 2019-09-24 14:05:00 -0400 | [diff] [blame] | 63 | checkstyleConfig 'com.puppycrawl.tools:checkstyle:8.23' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | task javadocJar(type: Jar) { |
| 67 | classifier = 'javadoc' |
| 68 | from javadoc |
| 69 | } |
| 70 | |
| 71 | task sourcesJar(type: Jar) { |
| 72 | classifier = 'sources' |
| 73 | from sourceSets.main.allSource |
| 74 | } |
| 75 | |
| 76 | task integrationTest(type: Test) { |
| 77 | description 'Compile and run integration tests' |
Alexander Afanasyev | d2bb7af | 2018-07-24 19:18:32 -0400 | [diff] [blame] | 78 | group = 'verification' |
| 79 | |
| 80 | testClassesDirs = sourceSets.integrationTest.output.classesDirs |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 81 | classpath = sourceSets.integrationTest.runtimeClasspath |
Alexander Afanasyev | d2bb7af | 2018-07-24 19:18:32 -0400 | [diff] [blame] | 82 | |
| 83 | mustRunAfter test |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 84 | } |
| 85 | |
Davide Pesavento | b5f84d2 | 2019-09-24 14:55:48 -0400 | [diff] [blame] | 86 | tasks.withType(JavaCompile) { |
| 87 | options.deprecation = true |
| 88 | } |
| 89 | |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 90 | tasks.withType(Test) { |
| 91 | reports.html.destination = file("${reporting.baseDir}/${name}") |
| 92 | testLogging { |
| 93 | events "passed", "skipped", "failed" |
| 94 | showStandardStreams = true |
| 95 | exceptionFormat = "full" |
| 96 | } |
Alexander Afanasyev | d2bb7af | 2018-07-24 19:18:32 -0400 | [diff] [blame] | 97 | outputs.upToDateWhen { false } |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 98 | } |
| 99 | |
Alexander Afanasyev | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 100 | tasks.withType(Checkstyle) { |
| 101 | checkstyleClasspath = project.configurations.checkstyleConfig |
| 102 | checkstyleMain { |
| 103 | exclude 'com/intel/jndn/management/enums/NfdTlv.java' |
| 104 | } |
| 105 | checkstyleTest { |
| 106 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 107 | } |
| 108 | checkstyleIntegrationTest { |
| 109 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 110 | } |
| 111 | } |
| 112 | |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 113 | if (JavaVersion.current().isJava8Compatible()) { |
| 114 | allprojects { |
| 115 | tasks.withType(Javadoc) { |
| 116 | options.addStringOption('Xdoclint:none', '-quiet') |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | artifacts { |
| 122 | archives javadocJar, sourcesJar |
| 123 | } |
| 124 | |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 125 | signing { |
| 126 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 127 | sign configurations.archives |
| 128 | } |
| 129 | |
| 130 | uploadArchives { |
| 131 | repositories { |
| 132 | mavenDeployer { |
| 133 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 134 | |
| 135 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 136 | try { |
| 137 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 138 | } |
| 139 | catch (Exception e) { |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
| 144 | try { |
| 145 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 146 | } |
| 147 | catch (Exception e) { |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | pom.project { |
| 152 | name 'jndn-management' |
| 153 | packaging 'jar' |
| 154 | description 'Tools for managing an NDN forwarding daemon' |
Davide Pesavento | b6df513 | 2019-09-24 14:05:00 -0400 | [diff] [blame] | 155 | url 'https://github.com/named-data/jndn-management' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 156 | |
| 157 | scm { |
Davide Pesavento | b6df513 | 2019-09-24 14:05:00 -0400 | [diff] [blame] | 158 | connection 'scm:git:https://github.com/named-data/jndn-management.git' |
| 159 | developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-management.git' |
| 160 | url 'https://github.com/named-data/jndn-management' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | licenses { |
| 164 | license { |
| 165 | name 'GNU Lesser General Public License, Version 3.0+' |
Davide Pesavento | b6df513 | 2019-09-24 14:05:00 -0400 | [diff] [blame] | 166 | url 'https://www.gnu.org/licenses/lgpl-3.0.html' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 167 | } |
| 168 | } |
| 169 | |
| 170 | developers { |
| 171 | developer { |
| 172 | id 'andrewbrown' |
| 173 | name 'Andrew Brown' |
| 174 | url 'https://github.com/andrewsbrown' |
| 175 | } |
| 176 | developer { |
| 177 | id 'cawka' |
| 178 | name 'Alexander Afanasyev' |
| 179 | email 'aa@cs.ucla.edu' |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | cobertura { |
| 188 | coverageFormats = ['html', 'xml'] |
| 189 | } |