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

Commit c44e357

Browse files
committed
Simplify directory structure and prepare upload to Maven Central
1 parent 2cbb365 commit c44e357

Some content is hidden

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

54 files changed

+1033
-990
lines changed
File renamed without changes.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# java-diff-utils [![Build Status](https://travis-ci.org/java-diff-utils/java-diff-utils.svg?branch=master)](https://travis-ci.org/java-diff-utils/java-diff-utils)
22

3-
> A library is for computing diffs, applying patches, generation side-by-side view in Java.
3+
> A library for computing diffs, applying patches, generation side-by-side view in Java.
44
55
`java-diff-utils` is an open source library for performing comparison operations between chunks of text: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future display (like a side-by-side view) and so on.
66

build.gradle

+103-18
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,114 @@
1-
buildscript {
2-
repositories {
3-
jcenter()
4-
}
5-
dependencies {
6-
classpath 'com.novoda:bintray-release:0.4.0' // clean build uploadLib -PdryRun=false
1+
apply plugin: 'java'
2+
apply plugin: 'maven'
3+
apply plugin: 'signing'
4+
5+
group = 'io.github.java-diff-utils'
6+
archivesBaseName = 'java-diff-utils'
7+
version = '2.2.0-SNAPSHOT'
8+
9+
sourceCompatibility = '1.7'
10+
targetCompatibility = '1.7'
11+
12+
dependencies {
13+
compile group: 'com.google.code.findbugs', name: 'jsr305', version:'3.0.0'
14+
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version:'1.3'
15+
testCompile group: 'junit', name: 'junit', version:'4.12'
16+
}
17+
18+
compileJava {
19+
// files are all encoded using UTF-8
20+
options.encoding = 'UTF-8'
21+
}
22+
23+
compileTestJava {
24+
// files are all encoded using UTF-8
25+
options.encoding = 'UTF-8'
26+
}
27+
28+
javadoc {
29+
failOnError = false
30+
options {
31+
// files are all encoded using UTF-8
32+
encoding = 'UTF-8'
33+
version = true
34+
author = true
735
}
836
}
937

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 = ""
38+
jar {
39+
manifest {
40+
attributes('Automatic-Module-Name': 'io.github.adr.embedded')
1741
}
1842
}
1943

20-
task uploadLib {
21-
dependsOn ':java-diff-utils-lib:bintrayUpload'
44+
repositories {
45+
jcenter()
2246
}
2347

24-
allprojects {
48+
tasks.withType(Javadoc) {
49+
options.addStringOption('Xdoclint:none', '-quiet')
50+
}
51+
52+
task javadocJar(type: Jar, dependsOn: javadoc) {
53+
classifier = 'javadoc'
54+
from javadoc.destinationDir
55+
}
56+
57+
task sourcesJar(type: Jar) {
58+
classifier = 'sources'
59+
from sourceSets.main.allSource
60+
}
61+
62+
artifacts {
63+
archives sourcesJar
64+
archives javadocJar
65+
}
66+
67+
signing {
68+
sign configurations.archives
69+
}
70+
71+
uploadArchives {
2572
repositories {
26-
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
27-
maven { url "http://repo.maven.apache.org/maven2" }
73+
mavenDeployer {
74+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
75+
76+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
77+
authentication(userName: ossrhUsername, password: ossrhPassword)
78+
}
79+
80+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
81+
authentication(userName: ossrhUsername, password: ossrhPassword)
82+
}
83+
84+
pom.project {
85+
name 'Java Diff Utils'
86+
packaging 'jar'
87+
// optionally artifactId can be defined here
88+
description 'A library for computing diffs, applying patches, generation side-by-side view in Java'
89+
url 'https://github.com/java-diff-utils/java-diff-utils'
90+
91+
scm {
92+
connection 'scm:git:https://github.com/java-diff-utils/java-diff-utils.git'
93+
developerConnection 'scm:git:github.com:java-diff-utils/java-diff-utils.git'
94+
url 'https://github.com/java-diff-utils/java-diff-utils/tree/master'
95+
}
96+
97+
licenses {
98+
license {
99+
name 'The Apache Software License, Version 1.1'
100+
url 'http://www.apache.org/licenses/LICENSE-1.1'
101+
}
102+
}
103+
104+
developers {
105+
developer {
106+
id 'koppor'
107+
name 'Oliver Kopp'
108+
109+
}
110+
}
111+
}
112+
}
28113
}
29114
}

gradle.properties

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
signing.keyId=
2+
signing.password=
3+
signing.secretKeyRingFile=
4+
5+
ossrhUsername=
6+
ossrhPassword=

java-diff-utils-lib/build.gradle

-48
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,86 @@
1-
/*
2-
* SPDX-License-Identifier: Apache-1.1
3-
*
4-
* ====================================================================
5-
* The Apache Software License, Version 1.1
6-
*
7-
* Copyright (c) 1999-2003 The Apache Software Foundation.
8-
* Copyright (c) 2010 Dmitry Naumenko ([email protected])
9-
* Copyright (c) 2015-2016 Brenden Kromhout and contributors to java-diff-utils
10-
* All rights reserved.
11-
*
12-
* Redistribution and use in source and binary forms, with or without
13-
* modification, are permitted provided that the following conditions
14-
* are met:
15-
*
16-
* 1. Redistributions of source code must retain the above copyright
17-
* notice, this list of conditions and the following disclaimer.
18-
*
19-
* 2. Redistributions in binary form must reproduce the above copyright
20-
* notice, this list of conditions and the following disclaimer in
21-
* the documentation and/or other materials provided with the
22-
* distribution.
23-
*
24-
* 3. The end-user documentation included with the redistribution, if
25-
* any, must include the following acknowledgement:
26-
* "This product includes software developed by the
27-
* Apache Software Foundation (http://www.apache.org/)."
28-
* Alternately, this acknowledgement may appear in the software itself,
29-
* if and wherever such third-party acknowledgements normally appear.
30-
*
31-
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
32-
* Foundation" must not be used to endorse or promote products derived
33-
* from this software without prior written permission. For written
34-
* permission, please contact [email protected].
35-
*
36-
* 5. Products derived from this software may not be called "Apache"
37-
* nor may "Apache" appear in their names without prior written
38-
* permission of the Apache Software Foundation.
39-
*
40-
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41-
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42-
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43-
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
44-
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47-
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50-
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51-
* SUCH DAMAGE.
52-
* ====================================================================
53-
*
54-
* This software consists of voluntary contributions made by many
55-
* individuals on behalf of the Apache Software Foundation. For more
56-
* information on the Apache Software Foundation, please see
57-
* <http://www.apache.org/>.
58-
*/
59-
60-
package difflib;
61-
62-
import java.io.Serializable;
63-
import java.util.Comparator;
64-
65-
/**
66-
* @author mksenzov
67-
* @param <?> The type of the compared elements in the 'lines'.
68-
*/
69-
public class DeltaComparator implements Comparator<Delta<?>>, Serializable {
70-
private static final long serialVersionUID = 1L;
71-
public static final Comparator<Delta<?>> INSTANCE = new DeltaComparator();
72-
73-
private DeltaComparator() {
74-
}
75-
76-
public int compare(final Delta<?> a, final Delta<?> b) {
77-
final int posA = a.getOriginal().getPosition();
78-
final int posB = b.getOriginal().getPosition();
79-
if (posA > posB) {
80-
return 1;
81-
} else if (posA < posB) {
82-
return -1;
83-
}
84-
return 0;
85-
}
86-
}
1+
/*
2+
* SPDX-License-Identifier: Apache-1.1
3+
*
4+
* ====================================================================
5+
* The Apache Software License, Version 1.1
6+
*
7+
* Copyright (c) 1999-2003 The Apache Software Foundation.
8+
* Copyright (c) 2010 Dmitry Naumenko ([email protected])
9+
* Copyright (c) 2015-2016 Brenden Kromhout and contributors to java-diff-utils
10+
* All rights reserved.
11+
*
12+
* Redistribution and use in source and binary forms, with or without
13+
* modification, are permitted provided that the following conditions
14+
* are met:
15+
*
16+
* 1. Redistributions of source code must retain the above copyright
17+
* notice, this list of conditions and the following disclaimer.
18+
*
19+
* 2. Redistributions in binary form must reproduce the above copyright
20+
* notice, this list of conditions and the following disclaimer in
21+
* the documentation and/or other materials provided with the
22+
* distribution.
23+
*
24+
* 3. The end-user documentation included with the redistribution, if
25+
* any, must include the following acknowledgement:
26+
* "This product includes software developed by the
27+
* Apache Software Foundation (http://www.apache.org/)."
28+
* Alternately, this acknowledgement may appear in the software itself,
29+
* if and wherever such third-party acknowledgements normally appear.
30+
*
31+
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
32+
* Foundation" must not be used to endorse or promote products derived
33+
* from this software without prior written permission. For written
34+
* permission, please contact [email protected].
35+
*
36+
* 5. Products derived from this software may not be called "Apache"
37+
* nor may "Apache" appear in their names without prior written
38+
* permission of the Apache Software Foundation.
39+
*
40+
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41+
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43+
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
44+
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47+
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51+
* SUCH DAMAGE.
52+
* ====================================================================
53+
*
54+
* This software consists of voluntary contributions made by many
55+
* individuals on behalf of the Apache Software Foundation. For more
56+
* information on the Apache Software Foundation, please see
57+
* <http://www.apache.org/>.
58+
*/
59+
60+
package difflib;
61+
62+
import java.io.Serializable;
63+
import java.util.Comparator;
64+
65+
/**
66+
* @author mksenzov
67+
* @param <?> The type of the compared elements in the 'lines'.
68+
*/
69+
public class DeltaComparator implements Comparator<Delta<?>>, Serializable {
70+
private static final long serialVersionUID = 1L;
71+
public static final Comparator<Delta<?>> INSTANCE = new DeltaComparator();
72+
73+
private DeltaComparator() {
74+
}
75+
76+
public int compare(final Delta<?> a, final Delta<?> b) {
77+
final int posA = a.getOriginal().getPosition();
78+
final int posB = b.getOriginal().getPosition();
79+
if (posA > posB) {
80+
return 1;
81+
} else if (posA < posB) {
82+
return -1;
83+
}
84+
return 0;
85+
}
86+
}

0 commit comments

Comments
 (0)