blob: bcddbe29b9d4426b5be2cd258c665f73c6a4b14b [file] [log] [blame]
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -08001buildscript {
2 repositories {
3 jcenter()
4 mavenCentral()
5 }
6}
7
Alexander Afanasyev71904a12016-02-17 14:50:13 -08008plugins {
9 id "org.sonarqube" version "1.2"
10 id 'net.saliman.cobertura' version '2.3.0'
11}
12
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080013apply plugin: 'java'
14apply plugin: 'maven'
15apply plugin: 'signing'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080016apply plugin: 'checkstyle'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080017
18group = 'com.intel.jndn.mock'
andrewsbrown5d0840a2016-06-10 14:36:49 -070019version = '1.0.3'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080020
21sourceCompatibility = JavaVersion.VERSION_1_7
22targetCompatibility = JavaVersion.VERSION_1_7
23compileJava.options.encoding = 'UTF-8'
24
25repositories {
26 jcenter()
27 mavenLocal()
28 mavenCentral()
29}
30
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080031configurations {
32 checkstyleConfig
33}
34
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080035dependencies {
andrewsbrown5d0840a2016-06-10 14:36:49 -070036 compile 'net.named-data:jndn:0.13'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080037
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080038 testCompile 'junit:junit:4.12'
Alexander Afanasyev71904a12016-02-17 14:50:13 -080039 testRuntime 'org.slf4j:slf4j-api:1.7.16'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080040
41 checkstyleConfig "com.puppycrawl.tools:checkstyle:6.15"
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080042}
43
44task javadocJar(type: Jar) {
45 classifier = 'javadoc'
46 from javadoc
47}
48
49task sourcesJar(type: Jar) {
50 classifier = 'sources'
51 from sourceSets.main.allSource
52}
53
54tasks.withType(Test) {
55 reports.html.destination = file("${reporting.baseDir}/${name}")
56 testLogging {
57 events "passed", "skipped", "failed"
58 showStandardStreams = true
59 exceptionFormat = "full"
60 }
61 outputs.upToDateWhen { false }
62}
63
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080064tasks.withType(Checkstyle) {
65 checkstyleClasspath = project.configurations.checkstyleConfig
66 checkstyleTest {
67 configFile file('config/checkstyle/checkstyle-test.xml')
68 }
69}
70
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080071if (JavaVersion.current().isJava8Compatible()) {
72 allprojects {
73 tasks.withType(Javadoc) {
74 options.addStringOption('Xdoclint:none', '-quiet')
75 }
76 }
77}
78
79artifacts {
80 archives javadocJar, sourcesJar
81}
82
83signing {
84 required { gradle.taskGraph.hasTask("uploadArchives") }
85 sign configurations.archives
86}
87
88uploadArchives {
89 repositories {
90 mavenDeployer {
91 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
92
93 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
94 try {
95 authentication(userName: ossrhUsername, password: ossrhPassword)
96 }
97 catch (Exception e) {
98 }
99 }
100
101 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
102 try {
103 authentication(userName: ossrhUsername, password: ossrhPassword)
104 }
105 catch (Exception e) {
106 }
107 }
108
109 pom.project {
110 name 'jndn-mock'
111 packaging 'jar'
112 description 'Tools for testing NDN Java code without using network IO'
113 url 'https://github.com/01org/jndn-mock'
114
115 scm {
116 connection 'scm:git:https://github.com/01org/jndn-mock'
117 developerConnection 'scm:git:https://github.com/01org/jndn-mock'
118 url 'https://github.com/01org/jndn-mock'
119 }
120
121 licenses {
122 license {
123 name 'GNU Lesser General Public License, Version 3.0+'
124 url 'http://www.gnu.org/licenses/lgpl.html'
125 }
126 }
127
128 developers {
129 developer {
130 id 'andrewbrown'
131 name 'Andrew Brown'
132 url 'https://github.com/andrewsbrown'
133 }
134 developer {
135 id 'cawka'
136 name 'Alexander Afanasyev'
137 email 'aa@cs.ucla.edu'
138 }
139 }
140 }
141 }
142 }
143}
Alexander Afanasyev71904a12016-02-17 14:50:13 -0800144
145cobertura {
146 coverageFormats = ['html', 'xml']
147}