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