Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 1 | buildscript { |
| 2 | repositories { |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 3 | mavenLocal() |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 4 | jcenter() |
| 5 | mavenCentral() |
| 6 | } |
| 7 | } |
| 8 | |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 9 | plugins { |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 10 | id 'java' |
| 11 | id 'maven' |
| 12 | id 'signing' |
| 13 | //id 'checkstyle' |
| 14 | id 'org.sonarqube' version '2.8' |
| 15 | id 'net.saliman.cobertura' version '3.0.0' |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 16 | } |
| 17 | |
Alexander Afanasyev | 288fcc9 | 2018-07-24 17:28:14 -0400 | [diff] [blame] | 18 | group = 'net.named-data.jndn-extra' |
Alexander Afanasyev | 20fb7b4 | 2020-05-18 21:12:32 -0400 | [diff] [blame^] | 19 | version = '1.2.0' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 20 | |
Davide Pesavento | 188529c | 2020-04-18 00:03:22 -0400 | [diff] [blame] | 21 | sourceCompatibility = JavaVersion.VERSION_1_8 |
| 22 | targetCompatibility = JavaVersion.VERSION_1_8 |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 23 | compileJava.options.encoding = 'UTF-8' |
| 24 | |
| 25 | repositories { |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 26 | mavenLocal() |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 27 | jcenter() |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 28 | mavenCentral() |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 29 | maven { |
| 30 | url "https://oss.sonatype.org/content/repositories/releases/" |
| 31 | } |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 32 | } |
| 33 | |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 34 | configurations { |
| 35 | checkstyleConfig |
| 36 | } |
| 37 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 38 | dependencies { |
Davide Pesavento | e5acb8d | 2020-04-18 00:22:45 -0400 | [diff] [blame] | 39 | compile 'net.named-data:jndn:0.24' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 40 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 41 | testCompile 'junit:junit:4.12' |
Davide Pesavento | e5acb8d | 2020-04-18 00:22:45 -0400 | [diff] [blame] | 42 | testRuntime 'org.slf4j:slf4j-api:1.7.30' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 43 | |
Davide Pesavento | e5acb8d | 2020-04-18 00:22:45 -0400 | [diff] [blame] | 44 | checkstyleConfig 'com.puppycrawl.tools:checkstyle:8.23' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | task javadocJar(type: Jar) { |
| 48 | classifier = 'javadoc' |
| 49 | from javadoc |
| 50 | } |
| 51 | |
| 52 | task sourcesJar(type: Jar) { |
| 53 | classifier = 'sources' |
| 54 | from sourceSets.main.allSource |
| 55 | } |
| 56 | |
Davide Pesavento | b8a7f02 | 2020-04-18 00:28:22 -0400 | [diff] [blame] | 57 | tasks.withType(JavaCompile) { |
| 58 | options.deprecation = true |
| 59 | } |
| 60 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 61 | tasks.withType(Test) { |
| 62 | reports.html.destination = file("${reporting.baseDir}/${name}") |
| 63 | testLogging { |
| 64 | events "passed", "skipped", "failed" |
| 65 | showStandardStreams = true |
| 66 | exceptionFormat = "full" |
| 67 | } |
| 68 | outputs.upToDateWhen { false } |
| 69 | } |
| 70 | |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 71 | tasks.withType(Checkstyle) { |
| 72 | checkstyleClasspath = project.configurations.checkstyleConfig |
| 73 | checkstyleTest { |
| 74 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 75 | } |
| 76 | } |
| 77 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 78 | if (JavaVersion.current().isJava8Compatible()) { |
| 79 | allprojects { |
| 80 | tasks.withType(Javadoc) { |
| 81 | options.addStringOption('Xdoclint:none', '-quiet') |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | artifacts { |
| 87 | archives javadocJar, sourcesJar |
| 88 | } |
| 89 | |
| 90 | signing { |
| 91 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 92 | sign configurations.archives |
| 93 | } |
| 94 | |
| 95 | uploadArchives { |
| 96 | repositories { |
| 97 | mavenDeployer { |
| 98 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 99 | |
| 100 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 101 | try { |
| 102 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 103 | } |
| 104 | catch (Exception e) { |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
| 109 | try { |
| 110 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 111 | } |
| 112 | catch (Exception e) { |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | pom.project { |
| 117 | name 'jndn-mock' |
| 118 | packaging 'jar' |
| 119 | description 'Tools for testing NDN Java code without using network IO' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 120 | url 'https://github.com/named-data/jndn-mock' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 121 | |
| 122 | scm { |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 123 | connection 'scm:git:https://github.com/named-data/jndn-mock.git' |
| 124 | developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-mock.git' |
| 125 | url 'https://github.com/named-data/jndn-mock' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | licenses { |
| 129 | license { |
| 130 | name 'GNU Lesser General Public License, Version 3.0+' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 131 | url 'https://www.gnu.org/licenses/lgpl-3.0.html' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 132 | } |
| 133 | } |
| 134 | |
| 135 | developers { |
| 136 | developer { |
| 137 | id 'andrewbrown' |
| 138 | name 'Andrew Brown' |
| 139 | url 'https://github.com/andrewsbrown' |
| 140 | } |
| 141 | developer { |
| 142 | id 'cawka' |
| 143 | name 'Alexander Afanasyev' |
| 144 | email 'aa@cs.ucla.edu' |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | } |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 151 | |
| 152 | cobertura { |
| 153 | coverageFormats = ['html', 'xml'] |
| 154 | } |