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