Skip to content

Commit b612757

Browse files
committed
gradle build file
1 parent 8d63ae2 commit b612757

File tree

5 files changed

+93
-4
lines changed

5 files changed

+93
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
.idea
44
node_modules
55
*.iml
6+
build
7+
.gradle
8+
gradle*

build.gradle

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
group = "net.codebox"
2+
version = "1.0.0"
3+
4+
apply plugin: 'java'
5+
apply plugin: 'idea'
6+
apply plugin: 'maven'
7+
apply plugin: 'signing'
8+
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
dependencies {
14+
testCompile group: 'junit', name: 'junit', version: '4.11'
15+
}
16+
17+
signing {
18+
sign configurations.archives
19+
}
20+
21+
task javadocJar(type: Jar) {
22+
classifier = 'javadoc'
23+
from javadoc
24+
}
25+
26+
task sourcesJar(type: Jar) {
27+
classifier = 'sources'
28+
from sourceSets.main.allSource
29+
}
30+
31+
artifacts {
32+
archives javadocJar, sourcesJar
33+
}
34+
35+
uploadArchives {
36+
repositories {
37+
mavenDeployer {
38+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
39+
40+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
41+
authentication(userName: ossrhUsername, password: ossrhPassword)
42+
}
43+
44+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
45+
authentication(userName: ossrhUsername, password: ossrhPassword)
46+
}
47+
48+
pom.project {
49+
name 'Homoglyph'
50+
packaging 'jar'
51+
artifactId 'homoglyph'
52+
description 'Library providing a homoplyph-aware text search function'
53+
url 'https://github.com/codebox/homoglyph'
54+
55+
scm {
56+
connection 'scm:[email protected]/codebox/homoglyph.git'
57+
developerConnection 'scm:[email protected]/codebox/homoglyph.git'
58+
url 'https://github.com/codebox/homoglyph'
59+
}
60+
61+
licenses {
62+
license {
63+
name 'MIT License'
64+
url 'https://opensource.org/licenses/MIT'
65+
}
66+
}
67+
68+
developers {
69+
developer {
70+
id 'codebox'
71+
name 'Rob Dawson'
72+
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}

java/src/Homoglyph.java renamed to src/main/java/net/codebox/homoglyph/Homoglyph.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package net.codebox.homoglyph;
2+
13
import java.io.BufferedReader;
24
import java.io.FileNotFoundException;
35
import java.io.FileReader;
@@ -12,7 +14,7 @@
1214
* You can supply your own list of homoglyphs, or use the char_codes.txt which should accompany this source file.
1315
* You can find the latest version of char_codes.txt at https://github.com/codebox/homoglyph
1416
*
15-
* @author Rob Dawson <[email protected]>
17+
* @author Rob Dawson
1618
*/
1719
public class Homoglyph {
1820
private static final List<Set<Integer>> homoglyphs = new ArrayList<Set<Integer>>();
@@ -24,9 +26,9 @@ public class Homoglyph {
2426
* must be represented using Integer rather than Character values because some are too large to be held by the
2527
* 16-bit Character type.
2628
*
27-
* @param homoglyphs
29+
* @param homoglyphs a List of Sets, with each Set containing a group of Unicode codepoints that are homoglyphs
2830
*/
29-
public Homoglyph(List<Set<Integer>> homoglyphs){
31+
public Homoglyph(final List<Set<Integer>> homoglyphs){
3032
this.homoglyphs.addAll(homoglyphs);
3133
}
3234

java/test/HomoglyphDataTest.java renamed to src/test/java/net/codebox/homoglyph/HomoglyphDataTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
package net.codebox.homoglyph;
2+
3+
import org.junit.Assert;
14
import org.junit.Before;
25
import org.junit.Test;
36

@@ -14,7 +17,7 @@ public class HomoglyphDataTest {
1417

1518
@Before
1619
public void setup() throws IOException {
17-
List<Set<Integer>> charCodes = Homoglyph.parseCharCodesFile("src/char_codes.txt");
20+
List<Set<Integer>> charCodes = Homoglyph.parseCharCodesFile("raw_data/char_codes.txt");
1821
homoglyph = new Homoglyph(charCodes);
1922
}
2023

java/test/HomoglyphLogicTest.java renamed to src/test/java/net/codebox/homoglyph/HomoglyphLogicTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
package net.codebox.homoglyph;
2+
3+
import org.junit.Assert;
14
import org.junit.Before;
25
import org.junit.Test;
36

0 commit comments

Comments
 (0)