Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 1 | plugins { |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 2 | id 'java-library' |
| 3 | id 'maven' // TODO: migrate to 'maven-publish' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 4 | id 'signing' |
Davide Pesavento | 8cda2f9 | 2020-11-01 23:08:09 -0500 | [diff] [blame] | 5 | id 'checkstyle' |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 6 | id 'org.sonarqube' version '3.0' |
| 7 | id 'net.saliman.cobertura' version '4.0.0' |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 8 | } |
| 9 | |
Alexander Afanasyev | 288fcc9 | 2018-07-24 17:28:14 -0400 | [diff] [blame] | 10 | group = 'net.named-data.jndn-extra' |
Alexander Afanasyev | 20fb7b4 | 2020-05-18 21:12:32 -0400 | [diff] [blame] | 11 | version = '1.2.0' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 12 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 13 | repositories { |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 14 | mavenLocal() |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 15 | jcenter() |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 16 | mavenCentral() |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 17 | maven { |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 18 | url 'https://oss.sonatype.org/content/repositories/releases' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 19 | } |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | dependencies { |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 23 | api 'net.named-data:jndn:0.24' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 24 | |
Davide Pesavento | 7b35115 | 2020-11-03 15:56:24 -0500 | [diff] [blame^] | 25 | testImplementation 'junit:junit:4.13.1' |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 26 | testRuntimeOnly 'org.slf4j:slf4j-api:1.7.30' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 27 | } |
| 28 | |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 29 | java { |
| 30 | sourceCompatibility = JavaVersion.VERSION_1_8 |
| 31 | targetCompatibility = JavaVersion.VERSION_1_8 |
| 32 | withJavadocJar() |
| 33 | withSourcesJar() |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 34 | } |
| 35 | |
Davide Pesavento | b8a7f02 | 2020-04-18 00:28:22 -0400 | [diff] [blame] | 36 | tasks.withType(JavaCompile) { |
| 37 | options.deprecation = true |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 38 | options.encoding = 'UTF-8' |
| 39 | } |
| 40 | |
| 41 | tasks.withType(Javadoc) { |
| 42 | options.addBooleanOption('Xdoclint:none', true) |
Davide Pesavento | b8a7f02 | 2020-04-18 00:28:22 -0400 | [diff] [blame] | 43 | } |
| 44 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 45 | tasks.withType(Test) { |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 46 | outputs.upToDateWhen { false } |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 47 | testLogging { |
| 48 | events "passed", "failed", "skipped" |
| 49 | exceptionFormat "full" |
| 50 | } |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 51 | } |
| 52 | |
Davide Pesavento | 8cda2f9 | 2020-11-01 23:08:09 -0500 | [diff] [blame] | 53 | checkstyle { |
| 54 | toolVersion '8.23' |
| 55 | } |
| 56 | checkstyleTest { |
| 57 | configFile file('config/checkstyle/checkstyle-test.xml') |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 58 | } |
| 59 | |
Davide Pesavento | a7362da | 2020-10-30 20:16:42 -0400 | [diff] [blame] | 60 | cobertura { |
| 61 | coverageFormats = ['html', 'xml'] |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | artifacts { |
| 65 | archives javadocJar, sourcesJar |
| 66 | } |
| 67 | |
| 68 | signing { |
| 69 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 70 | sign configurations.archives |
| 71 | } |
| 72 | |
| 73 | uploadArchives { |
| 74 | repositories { |
| 75 | mavenDeployer { |
| 76 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 77 | |
| 78 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 79 | try { |
| 80 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 81 | } |
| 82 | catch (Exception e) { |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
| 87 | try { |
| 88 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 89 | } |
| 90 | catch (Exception e) { |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | pom.project { |
| 95 | name 'jndn-mock' |
| 96 | packaging 'jar' |
| 97 | description 'Tools for testing NDN Java code without using network IO' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 98 | url 'https://github.com/named-data/jndn-mock' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 99 | |
| 100 | scm { |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 101 | connection 'scm:git:https://github.com/named-data/jndn-mock.git' |
| 102 | developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-mock.git' |
| 103 | url 'https://github.com/named-data/jndn-mock' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | licenses { |
| 107 | license { |
| 108 | name 'GNU Lesser General Public License, Version 3.0+' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 109 | url 'https://www.gnu.org/licenses/lgpl-3.0.html' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 110 | } |
| 111 | } |
| 112 | |
| 113 | developers { |
| 114 | developer { |
| 115 | id 'andrewbrown' |
| 116 | name 'Andrew Brown' |
| 117 | url 'https://github.com/andrewsbrown' |
| 118 | } |
| 119 | developer { |
| 120 | id 'cawka' |
| 121 | name 'Alexander Afanasyev' |
| 122 | email 'aa@cs.ucla.edu' |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | } |