Andrew Brown | fe6c21c | 2016-08-24 16:28:54 -0700 | [diff] [blame] | 1 | /* |
| 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 Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 15 | buildscript { |
| 16 | repositories { |
| 17 | jcenter() |
| 18 | mavenCentral() |
| 19 | } |
| 20 | } |
| 21 | |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 22 | plugins { |
| 23 | id "org.sonarqube" version "1.2" |
| 24 | id 'net.saliman.cobertura' version '2.3.0' |
| 25 | } |
| 26 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 27 | apply plugin: 'java' |
| 28 | apply plugin: 'maven' |
| 29 | apply plugin: 'signing' |
Andrew Brown | c9ba550 | 2016-08-25 09:40:53 -0700 | [diff] [blame] | 30 | //apply plugin: 'checkstyle' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 31 | |
| 32 | group = 'com.intel.jndn.mock' |
Andrew Brown | c9ba550 | 2016-08-25 09:40:53 -0700 | [diff] [blame] | 33 | version = '1.1.0' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 34 | |
| 35 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 36 | targetCompatibility = JavaVersion.VERSION_1_7 |
| 37 | compileJava.options.encoding = 'UTF-8' |
| 38 | |
| 39 | repositories { |
| 40 | jcenter() |
| 41 | mavenLocal() |
| 42 | mavenCentral() |
| 43 | } |
| 44 | |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 45 | configurations { |
| 46 | checkstyleConfig |
| 47 | } |
| 48 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 49 | dependencies { |
andrewsbrown | 5d0840a | 2016-06-10 14:36:49 -0700 | [diff] [blame] | 50 | compile 'net.named-data:jndn:0.13' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 51 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 52 | testCompile 'junit:junit:4.12' |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 53 | testRuntime 'org.slf4j:slf4j-api:1.7.16' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 54 | |
| 55 | checkstyleConfig "com.puppycrawl.tools:checkstyle:6.15" |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | task javadocJar(type: Jar) { |
| 59 | classifier = 'javadoc' |
| 60 | from javadoc |
| 61 | } |
| 62 | |
| 63 | task sourcesJar(type: Jar) { |
| 64 | classifier = 'sources' |
| 65 | from sourceSets.main.allSource |
| 66 | } |
| 67 | |
| 68 | tasks.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 Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 78 | tasks.withType(Checkstyle) { |
| 79 | checkstyleClasspath = project.configurations.checkstyleConfig |
| 80 | checkstyleTest { |
| 81 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 82 | } |
| 83 | } |
| 84 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 85 | if (JavaVersion.current().isJava8Compatible()) { |
| 86 | allprojects { |
| 87 | tasks.withType(Javadoc) { |
| 88 | options.addStringOption('Xdoclint:none', '-quiet') |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | artifacts { |
| 94 | archives javadocJar, sourcesJar |
| 95 | } |
| 96 | |
| 97 | signing { |
| 98 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 99 | sign configurations.archives |
| 100 | } |
| 101 | |
| 102 | uploadArchives { |
| 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 Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 158 | |
| 159 | cobertura { |
| 160 | coverageFormats = ['html', 'xml'] |
| 161 | } |