blob: ddc709a9dfc199dc6050f43d4d98ba6ad2a62557 [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 {
23 id "org.sonarqube" version "1.2"
24 id 'net.saliman.cobertura' version '2.3.0'
25}
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
32group = 'com.intel.jndn.mock'
Andrew Brownc9ba5502016-08-25 09:40:53 -070033version = '1.1.0'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080034
35sourceCompatibility = JavaVersion.VERSION_1_7
36targetCompatibility = JavaVersion.VERSION_1_7
37compileJava.options.encoding = 'UTF-8'
38
39repositories {
40 jcenter()
41 mavenLocal()
42 mavenCentral()
43}
44
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080045configurations {
46 checkstyleConfig
47}
48
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080049dependencies {
andrewsbrown5d0840a2016-06-10 14:36:49 -070050 compile 'net.named-data:jndn:0.13'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080051
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080052 testCompile 'junit:junit:4.12'
Alexander Afanasyev71904a12016-02-17 14:50:13 -080053 testRuntime 'org.slf4j:slf4j-api:1.7.16'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080054
55 checkstyleConfig "com.puppycrawl.tools:checkstyle:6.15"
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080056}
57
58task javadocJar(type: Jar) {
59 classifier = 'javadoc'
60 from javadoc
61}
62
63task sourcesJar(type: Jar) {
64 classifier = 'sources'
65 from sourceSets.main.allSource
66}
67
68tasks.withType(Test) {
69 reports.html.destination = file("${reporting.baseDir}/${name}")
70 testLogging {
71 events "passed", "skipped", "failed"
72 showStandardStreams = true
73 exceptionFormat = "full"
74 }
75 outputs.upToDateWhen { false }
76}
77
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080078tasks.withType(Checkstyle) {
79 checkstyleClasspath = project.configurations.checkstyleConfig
80 checkstyleTest {
81 configFile file('config/checkstyle/checkstyle-test.xml')
82 }
83}
84
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080085if (JavaVersion.current().isJava8Compatible()) {
86 allprojects {
87 tasks.withType(Javadoc) {
88 options.addStringOption('Xdoclint:none', '-quiet')
89 }
90 }
91}
92
93artifacts {
94 archives javadocJar, sourcesJar
95}
96
97signing {
98 required { gradle.taskGraph.hasTask("uploadArchives") }
99 sign configurations.archives
100}
101
102uploadArchives {
103 repositories {
104 mavenDeployer {
105 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
106
107 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
108 try {
109 authentication(userName: ossrhUsername, password: ossrhPassword)
110 }
111 catch (Exception e) {
112 }
113 }
114
115 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
116 try {
117 authentication(userName: ossrhUsername, password: ossrhPassword)
118 }
119 catch (Exception e) {
120 }
121 }
122
123 pom.project {
124 name 'jndn-mock'
125 packaging 'jar'
126 description 'Tools for testing NDN Java code without using network IO'
127 url 'https://github.com/01org/jndn-mock'
128
129 scm {
130 connection 'scm:git:https://github.com/01org/jndn-mock'
131 developerConnection 'scm:git:https://github.com/01org/jndn-mock'
132 url 'https://github.com/01org/jndn-mock'
133 }
134
135 licenses {
136 license {
137 name 'GNU Lesser General Public License, Version 3.0+'
138 url 'http://www.gnu.org/licenses/lgpl.html'
139 }
140 }
141
142 developers {
143 developer {
144 id 'andrewbrown'
145 name 'Andrew Brown'
146 url 'https://github.com/andrewsbrown'
147 }
148 developer {
149 id 'cawka'
150 name 'Alexander Afanasyev'
151 email 'aa@cs.ucla.edu'
152 }
153 }
154 }
155 }
156 }
157}
Alexander Afanasyev71904a12016-02-17 14:50:13 -0800158
159cobertura {
160 coverageFormats = ['html', 'xml']
161}