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' |
| 19 | version = '1.1.1' |
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 | |
| 57 | tasks.withType(Test) { |
| 58 | reports.html.destination = file("${reporting.baseDir}/${name}") |
| 59 | testLogging { |
| 60 | events "passed", "skipped", "failed" |
| 61 | showStandardStreams = true |
| 62 | exceptionFormat = "full" |
| 63 | } |
| 64 | outputs.upToDateWhen { false } |
| 65 | } |
| 66 | |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 67 | tasks.withType(Checkstyle) { |
| 68 | checkstyleClasspath = project.configurations.checkstyleConfig |
| 69 | checkstyleTest { |
| 70 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 71 | } |
| 72 | } |
| 73 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 74 | if (JavaVersion.current().isJava8Compatible()) { |
| 75 | allprojects { |
| 76 | tasks.withType(Javadoc) { |
| 77 | options.addStringOption('Xdoclint:none', '-quiet') |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | artifacts { |
| 83 | archives javadocJar, sourcesJar |
| 84 | } |
| 85 | |
| 86 | signing { |
| 87 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 88 | sign configurations.archives |
| 89 | } |
| 90 | |
| 91 | uploadArchives { |
| 92 | repositories { |
| 93 | mavenDeployer { |
| 94 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 95 | |
| 96 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 97 | try { |
| 98 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 99 | } |
| 100 | catch (Exception e) { |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
| 105 | try { |
| 106 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 107 | } |
| 108 | catch (Exception e) { |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | pom.project { |
| 113 | name 'jndn-mock' |
| 114 | packaging 'jar' |
| 115 | description 'Tools for testing NDN Java code without using network IO' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 116 | url 'https://github.com/named-data/jndn-mock' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 117 | |
| 118 | scm { |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 119 | connection 'scm:git:https://github.com/named-data/jndn-mock.git' |
| 120 | developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-mock.git' |
| 121 | url 'https://github.com/named-data/jndn-mock' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | licenses { |
| 125 | license { |
| 126 | name 'GNU Lesser General Public License, Version 3.0+' |
Davide Pesavento | c2a6570 | 2020-04-17 23:30:27 -0400 | [diff] [blame] | 127 | url 'https://www.gnu.org/licenses/lgpl-3.0.html' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 128 | } |
| 129 | } |
| 130 | |
| 131 | developers { |
| 132 | developer { |
| 133 | id 'andrewbrown' |
| 134 | name 'Andrew Brown' |
| 135 | url 'https://github.com/andrewsbrown' |
| 136 | } |
| 137 | developer { |
| 138 | id 'cawka' |
| 139 | name 'Alexander Afanasyev' |
| 140 | email 'aa@cs.ucla.edu' |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | } |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 147 | |
| 148 | cobertura { |
| 149 | coverageFormats = ['html', 'xml'] |
| 150 | } |