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 { |
Alexander Afanasyev | 288fcc9 | 2018-07-24 17:28:14 -0400 | [diff] [blame^] | 23 | id "org.sonarqube" version "2.6.2" |
| 24 | id 'net.saliman.cobertura' version '2.5.4' |
Alexander Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 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 | |
Alexander Afanasyev | 288fcc9 | 2018-07-24 17:28:14 -0400 | [diff] [blame^] | 32 | // group = 'com.intel.jndn.mock' |
| 33 | group = 'net.named-data.jndn-extra' |
| 34 | version = '1.1.1' |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 35 | |
| 36 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 37 | targetCompatibility = JavaVersion.VERSION_1_7 |
| 38 | compileJava.options.encoding = 'UTF-8' |
| 39 | |
| 40 | repositories { |
| 41 | jcenter() |
| 42 | mavenLocal() |
| 43 | mavenCentral() |
| 44 | } |
| 45 | |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 46 | configurations { |
| 47 | checkstyleConfig |
| 48 | } |
| 49 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 50 | dependencies { |
Alexander Afanasyev | 288fcc9 | 2018-07-24 17:28:14 -0400 | [diff] [blame^] | 51 | compile 'net.named-data:jndn:0.17' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 52 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 53 | testCompile 'junit:junit:4.12' |
Alexander Afanasyev | 288fcc9 | 2018-07-24 17:28:14 -0400 | [diff] [blame^] | 54 | testRuntime 'org.slf4j:slf4j-api:1.7.25' |
Alexander Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 55 | |
Alexander Afanasyev | 288fcc9 | 2018-07-24 17:28:14 -0400 | [diff] [blame^] | 56 | checkstyleConfig "com.puppycrawl.tools:checkstyle:8.11" |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | task javadocJar(type: Jar) { |
| 60 | classifier = 'javadoc' |
| 61 | from javadoc |
| 62 | } |
| 63 | |
| 64 | task sourcesJar(type: Jar) { |
| 65 | classifier = 'sources' |
| 66 | from sourceSets.main.allSource |
| 67 | } |
| 68 | |
| 69 | tasks.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 Afanasyev | cbc4101 | 2016-02-19 20:10:57 -0800 | [diff] [blame] | 79 | tasks.withType(Checkstyle) { |
| 80 | checkstyleClasspath = project.configurations.checkstyleConfig |
| 81 | checkstyleTest { |
| 82 | configFile file('config/checkstyle/checkstyle-test.xml') |
| 83 | } |
| 84 | } |
| 85 | |
Alexander Afanasyev | 8e9330f | 2016-01-25 19:13:40 -0800 | [diff] [blame] | 86 | if (JavaVersion.current().isJava8Compatible()) { |
| 87 | allprojects { |
| 88 | tasks.withType(Javadoc) { |
| 89 | options.addStringOption('Xdoclint:none', '-quiet') |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | artifacts { |
| 95 | archives javadocJar, sourcesJar |
| 96 | } |
| 97 | |
| 98 | signing { |
| 99 | required { gradle.taskGraph.hasTask("uploadArchives") } |
| 100 | sign configurations.archives |
| 101 | } |
| 102 | |
| 103 | uploadArchives { |
| 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 Afanasyev | 71904a1 | 2016-02-17 14:50:13 -0800 | [diff] [blame] | 159 | |
| 160 | cobertura { |
| 161 | coverageFormats = ['html', 'xml'] |
| 162 | } |