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 | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 10 | id 'org.sonarqube' version '1.2' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 11 | id 'net.saliman.cobertura' version '2.3.0' |
| 12 | } |
| 13 | |
| 14 | apply plugin: 'java' |
| 15 | apply plugin: 'maven' |
| 16 | apply plugin: 'signing' |
| 17 | apply plugin: 'maven-publish' |
Alexander Afanasyev | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 18 | apply plugin: 'checkstyle' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 19 | |
| 20 | group = 'com.intel.jndn.management' |
| 21 | version = '1.0.1-SNAPSHOT' |
| 22 | |
| 23 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 24 | targetCompatibility = JavaVersion.VERSION_1_7 |
| 25 | compileJava.options.encoding = 'UTF-8' |
| 26 | |
| 27 | repositories { |
| 28 | mavenLocal() |
| 29 | jcenter() |
| 30 | mavenCentral() |
| 31 | maven { |
| 32 | url "https://oss.sonatype.org/content/repositories/snapshots/" |
| 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 { |
| 59 | compile 'net.named-data:jndn:0.10' |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 60 | |
| 61 | testCompile 'junit:junit:4.12' |
| 62 | testCompile 'com.intel.jndn.mock:jndn-mock:1.0.1' |
| 63 | testRuntime 'org.slf4j:slf4j-api:1.7.16' |
Alexander Afanasyev | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 64 | |
| 65 | checkstyleConfig "com.puppycrawl.tools:checkstyle:6.15" |
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' |
| 80 | testClassesDir = sourceSets.integrationTest.output.classesDir |
| 81 | classpath = sourceSets.integrationTest.runtimeClasspath |
| 82 | } |
| 83 | |
| 84 | tasks.withType(Test) { |
| 85 | reports.html.destination = file("${reporting.baseDir}/${name}") |
| 86 | testLogging { |
| 87 | events "passed", "skipped", "failed" |
| 88 | showStandardStreams = true |
| 89 | exceptionFormat = "full" |
| 90 | } |
Alexander Afanasyev | 3c5ae7c | 2016-02-19 19:33:21 -0800 | [diff] [blame] | 91 | // outputs.upToDateWhen { false } |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 92 | } |
| 93 | |
Alexander Afanasyev | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 94 | tasks.withType(Checkstyle) { |
| 95 | checkstyleClasspath = project.configurations.checkstyleConfig |
| 96 | checkstyleMain { |
| 97 | exclude 'com/intel/jndn/management/enums/NfdTlv.java' |
| 98 | } |
| 99 | checkstyleTest { |
| 100 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 101 | } |
| 102 | checkstyleIntegrationTest { |
| 103 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 104 | } |
| 105 | } |
| 106 | |
Alexander Afanasyev | ccb373d | 2016-01-25 11:28:18 -0800 | [diff] [blame] | 107 | if (JavaVersion.current().isJava8Compatible()) { |
| 108 | allprojects { |
| 109 | tasks.withType(Javadoc) { |
| 110 | options.addStringOption('Xdoclint:none', '-quiet') |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | artifacts { |
| 116 | archives javadocJar, sourcesJar |
| 117 | } |
| 118 | |
| 119 | publishing { |
| 120 | publications { |
| 121 | mavenJava(MavenPublication) { |
| 122 | artifact javadocJar |
| 123 | artifact sourcesJar |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | signing { |
| 129 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 130 | sign configurations.archives |
| 131 | } |
| 132 | |
| 133 | uploadArchives { |
| 134 | repositories { |
| 135 | mavenDeployer { |
| 136 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 137 | |
| 138 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 139 | try { |
| 140 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 141 | } |
| 142 | catch (Exception e) { |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
| 147 | try { |
| 148 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 149 | } |
| 150 | catch (Exception e) { |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | pom.project { |
| 155 | name 'jndn-management' |
| 156 | packaging 'jar' |
| 157 | description 'Tools for managing an NDN forwarding daemon' |
| 158 | url 'https://github.com/01org/jndn-management' |
| 159 | |
| 160 | scm { |
| 161 | connection 'scm:git:https://github.com/cawka/jndn-management' |
| 162 | developerConnection 'scm:git:https://github.com/01org/jndn-management' |
| 163 | url 'https://github.com/01org/jndn-management' |
| 164 | } |
| 165 | |
| 166 | licenses { |
| 167 | license { |
| 168 | name 'GNU Lesser General Public License, Version 3.0+' |
| 169 | url 'http://www.gnu.org/licenses/lgpl.html' |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | developers { |
| 174 | developer { |
| 175 | id 'andrewbrown' |
| 176 | name 'Andrew Brown' |
| 177 | url 'https://github.com/andrewsbrown' |
| 178 | } |
| 179 | developer { |
| 180 | id 'cawka' |
| 181 | name 'Alexander Afanasyev' |
| 182 | email 'aa@cs.ucla.edu' |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | cobertura { |
| 191 | coverageFormats = ['html', 'xml'] |
| 192 | } |