Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 1 | buildscript { |
| 2 | repositories { |
| 3 | jcenter() |
| 4 | mavenCentral() |
| 5 | } |
| 6 | } |
| 7 | |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 8 | plugins { |
| 9 | id "org.sonarqube" version "1.2" |
| 10 | id 'net.saliman.cobertura' version '2.3.0' |
| 11 | } |
| 12 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 13 | apply plugin: 'java' |
| 14 | apply plugin: 'maven' |
| 15 | apply plugin: 'signing' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 16 | apply plugin: 'checkstyle' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 17 | |
| 18 | group = 'com.intel.jndn.mock' |
andrewsbrown | 5d0840a | 2016-06-10 14:36:49 -0700 | [diff] [blame] | 19 | version = '1.0.3' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 20 | |
| 21 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 22 | targetCompatibility = JavaVersion.VERSION_1_7 |
| 23 | compileJava.options.encoding = 'UTF-8' |
| 24 | |
| 25 | repositories { |
| 26 | jcenter() |
| 27 | mavenLocal() |
| 28 | mavenCentral() |
| 29 | } |
| 30 | |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 31 | configurations { |
| 32 | checkstyleConfig |
| 33 | } |
| 34 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 35 | dependencies { |
andrewsbrown | 5d0840a | 2016-06-10 14:36:49 -0700 | [diff] [blame] | 36 | compile 'net.named-data:jndn:0.13' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 37 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 38 | testCompile 'junit:junit:4.12' |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 39 | testRuntime 'org.slf4j:slf4j-api:1.7.16' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 40 | |
| 41 | checkstyleConfig "com.puppycrawl.tools:checkstyle:6.15" |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | task javadocJar(type: Jar) { |
| 45 | classifier = 'javadoc' |
| 46 | from javadoc |
| 47 | } |
| 48 | |
| 49 | task sourcesJar(type: Jar) { |
| 50 | classifier = 'sources' |
| 51 | from sourceSets.main.allSource |
| 52 | } |
| 53 | |
| 54 | tasks.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 Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 64 | tasks.withType(Checkstyle) { |
| 65 | checkstyleClasspath = project.configurations.checkstyleConfig |
| 66 | checkstyleTest { |
| 67 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 68 | } |
| 69 | } |
| 70 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 71 | if (JavaVersion.current().isJava8Compatible()) { |
| 72 | allprojects { |
| 73 | tasks.withType(Javadoc) { |
| 74 | options.addStringOption('Xdoclint:none', '-quiet') |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | artifacts { |
| 80 | archives javadocJar, sourcesJar |
| 81 | } |
| 82 | |
| 83 | signing { |
| 84 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 85 | sign configurations.archives |
| 86 | } |
| 87 | |
| 88 | uploadArchives { |
| 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 Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 144 | |
| 145 | cobertura { |
| 146 | coverageFormats = ['html', 'xml'] |
| 147 | } |