blob: fda54cca6381779083cbbdca2aaedd5e51771990 [file] [log] [blame]
Andrew Brownfe6c21c2016-08-24 16:28:54 -07001/*
2 * jndn-mock
3 * Copyright (c) 2016, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU Lesser General Public License,
7 * version 3, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT ANY
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
12 * more details.
13 */
14
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080015buildscript {
16 repositories {
17 jcenter()
18 mavenCentral()
19 }
20}
21
Alexander Afanasyev71904a12016-02-17 14:50:13 -080022plugins {
Alexander Afanasyev288fcc92018-07-24 17:28:14 -040023 id "org.sonarqube" version "2.6.2"
24 id 'net.saliman.cobertura' version '2.5.4'
Alexander Afanasyev71904a12016-02-17 14:50:13 -080025}
26
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080027apply plugin: 'java'
28apply plugin: 'maven'
29apply plugin: 'signing'
Andrew Brownc9ba5502016-08-25 09:40:53 -070030//apply plugin: 'checkstyle'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080031
Alexander Afanasyev288fcc92018-07-24 17:28:14 -040032// group = 'com.intel.jndn.mock'
33group = 'net.named-data.jndn-extra'
34version = '1.1.1'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080035
36sourceCompatibility = JavaVersion.VERSION_1_7
37targetCompatibility = JavaVersion.VERSION_1_7
38compileJava.options.encoding = 'UTF-8'
39
40repositories {
41 jcenter()
42 mavenLocal()
43 mavenCentral()
44}
45
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080046configurations {
47 checkstyleConfig
48}
49
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080050dependencies {
Alexander Afanasyev288fcc92018-07-24 17:28:14 -040051 compile 'net.named-data:jndn:0.17'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080052
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080053 testCompile 'junit:junit:4.12'
Alexander Afanasyev288fcc92018-07-24 17:28:14 -040054 testRuntime 'org.slf4j:slf4j-api:1.7.25'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080055
Alexander Afanasyev288fcc92018-07-24 17:28:14 -040056 checkstyleConfig "com.puppycrawl.tools:checkstyle:8.11"
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080057}
58
59task javadocJar(type: Jar) {
60 classifier = 'javadoc'
61 from javadoc
62}
63
64task sourcesJar(type: Jar) {
65 classifier = 'sources'
66 from sourceSets.main.allSource
67}
68
69tasks.withType(Test) {
70 reports.html.destination = file("${reporting.baseDir}/${name}")
71 testLogging {
72 events "passed", "skipped", "failed"
73 showStandardStreams = true
74 exceptionFormat = "full"
75 }
76 outputs.upToDateWhen { false }
77}
78
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080079tasks.withType(Checkstyle) {
80 checkstyleClasspath = project.configurations.checkstyleConfig
81 checkstyleTest {
82 configFile file('config/checkstyle/checkstyle-test.xml')
83 }
84}
85
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080086if (JavaVersion.current().isJava8Compatible()) {
87 allprojects {
88 tasks.withType(Javadoc) {
89 options.addStringOption('Xdoclint:none', '-quiet')
90 }
91 }
92}
93
94artifacts {
95 archives javadocJar, sourcesJar
96}
97
98signing {
99 required { gradle.taskGraph.hasTask("uploadArchives") }
100 sign configurations.archives
101}
102
103uploadArchives {
104 repositories {
105 mavenDeployer {
106 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
107
108 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
109 try {
110 authentication(userName: ossrhUsername, password: ossrhPassword)
111 }
112 catch (Exception e) {
113 }
114 }
115
116 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
117 try {
118 authentication(userName: ossrhUsername, password: ossrhPassword)
119 }
120 catch (Exception e) {
121 }
122 }
123
124 pom.project {
125 name 'jndn-mock'
126 packaging 'jar'
127 description 'Tools for testing NDN Java code without using network IO'
128 url 'https://github.com/01org/jndn-mock'
129
130 scm {
131 connection 'scm:git:https://github.com/01org/jndn-mock'
132 developerConnection 'scm:git:https://github.com/01org/jndn-mock'
133 url 'https://github.com/01org/jndn-mock'
134 }
135
136 licenses {
137 license {
138 name 'GNU Lesser General Public License, Version 3.0+'
139 url 'http://www.gnu.org/licenses/lgpl.html'
140 }
141 }
142
143 developers {
144 developer {
145 id 'andrewbrown'
146 name 'Andrew Brown'
147 url 'https://github.com/andrewsbrown'
148 }
149 developer {
150 id 'cawka'
151 name 'Alexander Afanasyev'
152 email 'aa@cs.ucla.edu'
153 }
154 }
155 }
156 }
157 }
158}
Alexander Afanasyev71904a12016-02-17 14:50:13 -0800159
160cobertura {
161 coverageFormats = ['html', 'xml']
162}