Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Commit 3b3a516

Browse files
committed
Rework project structure a bit to clean up gradle files
Prep for uploading to jCenter instead of needing Jitpack
1 parent 1f43131 commit 3b3a516

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+75
-39
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ out/
1515

1616
# Local configuration file (sdk path, etc)
1717
local.properties
18+
private.properties
1819

1920
# Eclipse project files
2021
.classpath
@@ -33,6 +34,3 @@ local.properties
3334
# Keystore and properties
3435
*.keystore
3536
keystore.properties
36-
37-
FictionDL.jar
38-
FictionDL-old.jar

build.gradle

+22-33
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,29 @@
1-
apply plugin: 'java'
2-
apply plugin: 'maven'
3-
4-
group = 'com.github.java-diff-utils'
5-
version = '2.1.1'
6-
7-
description = """java-diff-utils"""
8-
9-
sourceCompatibility = 1.7
10-
targetCompatibility = 1.7
11-
12-
task sourcesJar(type: Jar, dependsOn: classes) {
13-
classifier = 'sources'
14-
from sourceSets.main.allSource
15-
}
16-
17-
javadoc {
18-
failOnError = false
19-
}
20-
21-
task javadocJar(type: Jar, dependsOn: javadoc) {
22-
classifier = 'javadoc'
23-
from javadoc.destinationDir
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
}
5+
dependencies {
6+
classpath 'com.novoda:bintray-release:0.4.0' // clean build uploadLib -PdryRun=false
7+
}
248
}
259

26-
artifacts {
27-
archives sourcesJar
28-
archives javadocJar
10+
ext {
11+
if (file("private.properties").exists()) {
12+
Properties props = new Properties()
13+
props.load(new FileInputStream(file("private.properties")))
14+
BINTRAY_KEY = props.getProperty('BINTRAY_KEY')
15+
} else {
16+
BINTRAY_KEY = ""
17+
}
2918
}
3019

31-
repositories {
32-
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
33-
maven { url "http://repo.maven.apache.org/maven2" }
20+
task uploadLib {
21+
dependsOn ':java-diff-utils-lib:bintrayUpload'
3422
}
3523

36-
dependencies {
37-
compile group: 'com.google.code.findbugs', name: 'jsr305', version:'3.0.0'
38-
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version:'1.3'
39-
testCompile group: 'junit', name: 'junit', version:'4.12'
24+
allprojects {
25+
repositories {
26+
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
27+
maven { url "http://repo.maven.apache.org/maven2" }
28+
}
4029
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Feb 23 21:24:53 EST 2016
1+
#Wed Nov 23 10:50:46 EST 2016
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-bin.zip

java-diff-utils-lib/build.gradle

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apply plugin: 'java'
2+
apply plugin: 'com.novoda.bintray-release'
3+
4+
sourceCompatibility = 1.7
5+
targetCompatibility = 1.7
6+
7+
dependencies {
8+
compile group: 'com.google.code.findbugs', name: 'jsr305', version:'3.0.0'
9+
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version:'1.3'
10+
testCompile group: 'junit', name: 'junit', version:'4.12'
11+
}
12+
13+
task sourcesJar(type: Jar, dependsOn: classes) {
14+
classifier = 'sources'
15+
from sourceSets.main.allSource
16+
}
17+
18+
javadoc {
19+
failOnError = false
20+
}
21+
22+
if (JavaVersion.current().isJava8Compatible()) {
23+
tasks.withType(Javadoc) {
24+
options.addStringOption('Xdoclint:none', '-quiet')
25+
}
26+
}
27+
28+
task javadocJar(type: Jar, dependsOn: javadoc) {
29+
classifier = 'javadoc'
30+
from javadoc.destinationDir
31+
}
32+
33+
artifacts {
34+
archives sourcesJar
35+
archives javadocJar
36+
}
37+
38+
publish {
39+
bintrayUser = 'bkromhout'
40+
bintrayKey = BINTRAY_KEY
41+
userOrg = 'bkromhout'
42+
groupId = 'com.github.bkromhout'
43+
artifactId = 'java-diff-utils'
44+
version = '2.1.1'
45+
desc = 'The java-diff-utils library is for computing diffs, applying patches, generation side-by-side view in Java.'
46+
website = 'https://github.com/bkromhout/java-diff-utils'
47+
licences = ['Apache-2.0']
48+
}

src/main/java/difflib/Chunk.java renamed to java-diff-utils-lib/src/main/java/difflib/Chunk.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public int size() {
9595
}
9696

9797
/**
98-
* Returns the index of the last line of the chunk. (zero-based numbering)
98+
* @return the index of the last line of the chunk. (zero-based numbering)
9999
*/
100100
@Nonnegative
101101
public int last() {

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
include ':java-diff-utils-lib'
12
rootProject.name = 'java-diff-utils'

0 commit comments

Comments
 (0)