Skip to content

Commit 891f19e

Browse files
committed
Migrated to Gradle
1 parent 1c9b54c commit 891f19e

File tree

6 files changed

+450
-0
lines changed

6 files changed

+450
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ target
1818
*.war
1919
*.ear
2020
.idea
21+
22+
build
23+
.gradle
24+
.DS_Store

build.gradle

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
}
5+
dependencies {
6+
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.2.0'
7+
classpath "com.smokejumperit.gradle.license:Gradle-License-Report:0.0.2"
8+
}
9+
}
10+
11+
plugins {
12+
id 'java'
13+
id 'groovy'
14+
id 'osgi'
15+
id 'net.saliman.cobertura' version '2.4.0'
16+
id 'com.github.kt3k.coveralls' version '2.7.1'
17+
id "com.jfrog.bintray" version "1.7.3"
18+
}
19+
20+
apply plugin: 'license-report'
21+
apply plugin: 'ru.vyarus.animalsniffer'
22+
apply plugin: 'maven-publish'
23+
24+
group = 'de.danielbechler'
25+
version = '0.95-RC1'
26+
27+
description = """Java Object Diff"""
28+
29+
sourceCompatibility = 1.5
30+
targetCompatibility = 1.5
31+
32+
tasks.withType(JavaCompile) {
33+
options.encoding = 'UTF-8'
34+
}
35+
36+
repositories {
37+
mavenCentral()
38+
}
39+
40+
sourceSets {
41+
main {
42+
java {
43+
srcDirs = ['src/main/java']
44+
}
45+
groovy {
46+
srcDirs = []
47+
}
48+
}
49+
test {
50+
java {
51+
srcDirs = []
52+
}
53+
groovy {
54+
srcDirs = ['src/test/java']
55+
}
56+
}
57+
intTest {
58+
groovy {
59+
compileClasspath += main.output + test.output
60+
runtimeClasspath += main.output + test.output
61+
srcDirs = ['src/integration-test/java']
62+
}
63+
}
64+
}
65+
66+
configurations {
67+
intTestCompile.extendsFrom testCompile
68+
intTestRuntime.extendsFrom testRuntime
69+
}
70+
71+
task intTest(type: Test) {
72+
testClassesDir = sourceSets.intTest.output.classesDir
73+
classpath = sourceSets.intTest.runtimeClasspath
74+
}
75+
76+
compileGroovy {
77+
// somehow the groovy compile deletes the java compiled classes from the build directory
78+
dependsOn = []
79+
}
80+
81+
jar {
82+
manifest {
83+
instruction 'Bundle-Vendor', 'Daniel Bechler'
84+
instruction 'Bundle-DocURL', 'https://github.com/SQiShER/java-object-diff'
85+
instruction 'Export-Package', '{local-packages}'
86+
}
87+
}
88+
89+
dependencies {
90+
signature 'org.codehaus.mojo.signature:java15:1.0@signature'
91+
signature 'org.codehaus.mojo.signature:java16:1.1@signature'
92+
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
93+
// For Android support:
94+
// signature 'net.sf.androidscents.signature:android-api-level-23:6.0_r3@signature'
95+
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.18'
96+
testCompile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.7'
97+
testCompile group: 'ch.qos.logback', name: 'logback-core', version: '1.1.6'
98+
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.6'
99+
testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4'
100+
testCompile group: 'cglib', name: 'cglib-nodep', version: '3.2.1'
101+
testCompile group: 'org.objenesis', name: 'objenesis', version: '2.2'
102+
}
103+
104+
cobertura {
105+
coverageFormats = ['html', 'xml']
106+
coverageIgnoreTrivial = true
107+
}
108+
109+
bintray {
110+
user = System.getenv('BINTRAY_USER')
111+
key = System.getenv('BINTRAY_KEY')
112+
publications = ['mavenJava']
113+
publish = true
114+
pkg {
115+
repo = 'maven'
116+
name = 'java-object-diff'
117+
licenses = ['Apache-2.0']
118+
vcsUrl = 'https://github.com/SQiShER/java-object-diff.git'
119+
githubRepo = 'SQiShER/java-object-diff'
120+
githubReleaseNotesFile = 'README.md'
121+
version {
122+
name = project.version
123+
released = new Date()
124+
vcsTag = rootProject.name + '-' + project.version
125+
gpg {
126+
sign = true
127+
passphrase = System.getenv('BINTRAY_GPG_PASSPHRASE')
128+
}
129+
}
130+
}
131+
}
132+
133+
javadoc {
134+
failOnError = false
135+
}
136+
137+
task sourcesJar(type: Jar, dependsOn: classes) {
138+
classifier = 'sources'
139+
from sourceSets.main.allSource
140+
}
141+
142+
task javadocJar(type: Jar, dependsOn: javadoc) {
143+
classifier = 'javadoc'
144+
from javadoc.destinationDir
145+
}
146+
147+
artifacts {
148+
archives sourcesJar, javadocJar
149+
}
150+
151+
def pomConfig = {
152+
licenses {
153+
license {
154+
name "The Apache Software License, Version 2.0"
155+
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
156+
distribution "repo"
157+
}
158+
}
159+
developers {
160+
developer {
161+
id "sqisher"
162+
name "Daniel Bechler"
163+
url "https://github.com/SQiShER"
164+
}
165+
}
166+
}
167+
168+
publishing {
169+
publications {
170+
mavenJava(MavenPublication) {
171+
from components.java
172+
artifact sourcesJar
173+
artifact javadocJar
174+
pom.withXml {
175+
def root = asNode()
176+
root.appendNode('description', 'Library to diff and merge Java objects with ease')
177+
root.appendNode('name', 'java-object-diff')
178+
root.appendNode('url', 'https://github.com/SQiShER/java-object-diff')
179+
root.children().last() + pomConfig
180+
}
181+
}
182+
}
183+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sat Dec 31 15:06:50 CET 2016
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip

gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)