Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 7569677

Browse files
jentfooMike Jensen
authored andcommitted
Initial commit of code moved over from ambush
This is a huge leg up on the GUI code since it was started in ambush's main repo. We are adding it here so that the code can be developed more independently.
1 parent db1c6bd commit 7569677

File tree

15 files changed

+2387
-0
lines changed

15 files changed

+2387
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.class
2+
3+
# Package Files #
4+
*.jar
5+
*.war
6+
*.ear
7+
8+
.gradle
9+
build
10+
/bin

LICENSE

Lines changed: 383 additions & 0 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
apply plugin: 'java'
2+
apply plugin: 'checkstyle'
3+
apply plugin: 'jacoco'
4+
apply plugin: 'maven'
5+
6+
group = 'org.threadly'
7+
version = '0.1.0-SNAPSHOT'
8+
9+
repositories {
10+
mavenCentral()
11+
maven {
12+
url 'https://oss.sonatype.org/content/repositories/snapshots/'
13+
}
14+
maven {
15+
url 'https://swt-repo.googlecode.com/svn/repo/'
16+
}
17+
}
18+
19+
public String getSWTWindowingLibrary(String platform) {
20+
switch (platform.replaceAll(' ', '').toLowerCase()) {
21+
case ~/.*linux.*/: return 'gtk'
22+
case ~/.*darwin.*/: return 'cocoa'
23+
case ~/.*osx.*/: return 'cocoa'
24+
case ~/.*win.*/: return 'win32'
25+
default: return null
26+
}
27+
}
28+
29+
public String getSWTPlatform(String platform) {
30+
switch(platform.replaceAll(' ', '').toLowerCase()) {
31+
case ~/.*linux.*/: return 'linux'
32+
case ~/.*darwin.*/: return 'macosx'
33+
case ~/.*osx.*/: return 'macosx'
34+
case ~/.*win.*/: return 'win32'
35+
default: return platform
36+
}
37+
}
38+
39+
public String getSWTArch(String arch) {
40+
switch(arch) {
41+
case ~/.*64.*/: return 'x86_64'
42+
default: return 'x86'
43+
}
44+
}
45+
46+
ext {
47+
swtVersion = '4.3'
48+
swtWindowingLibrary = getSWTWindowingLibrary(System.properties['os.name'])
49+
swtArch = getSWTArch(System.properties['os.arch'])
50+
swtPlatform = getSWTPlatform(System.properties['os.name'])
51+
swtArtifactName = "org.eclipse.swt.${swtWindowingLibrary}.${swtPlatform}.${swtArch}"
52+
}
53+
54+
dependencies {
55+
testCompile group: 'junit', name: 'junit', version: '4.12'
56+
57+
compile (
58+
"org.threadly:ambush:+",
59+
"org.eclipse.swt:${swtArtifactName}:${swtVersion}"
60+
)
61+
}
62+
63+
compileJava {
64+
options.compilerArgs << "-Xlint:all" << "-Werror"
65+
}
66+
67+
compileTestJava {
68+
options.compilerArgs << "-Xlint:all" << "-Werror"
69+
}
70+
71+
jar {
72+
manifest {
73+
attributes 'Implementation-Title': 'AmbushGUI', 'Implementation-Version': version
74+
}
75+
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
76+
}
77+
78+
plugins.withType(JavaPlugin) {
79+
checkstyle.sourceSets = [sourceSets.main]
80+
}
81+
82+
test {
83+
jacoco {
84+
excludes = ['**/package-info**','**/*Test']
85+
destinationFile = file("$buildDir/reports/jacoco/test.exec")
86+
}
87+
getReports().getJunitXml().setDestination(file("${buildDir}/reports/tests/xml"))
88+
getReports().getHtml().setDestination(file("${buildDir}/reports/tests/html"))
89+
setBinResultsDir(file("${buildDir}/reports/tests/bin"))
90+
}
91+
92+
build.dependsOn("jacocoTestReport");
93+
94+
jacocoTestReport {
95+
doFirst {
96+
classDirectories = fileTree(dir: 'build/classes/main', include: 'org/threadly/**')
97+
sourceDirectories = fileTree(dir: 'scr/main/java', include: 'org/threadly/**')
98+
}
99+
reports {
100+
csv.enabled false
101+
xml.enabled true
102+
xml.destination "${buildDir}/reports/jacoco/jacoco.xml"
103+
html.enabled true
104+
html.destination "${buildDir}/reports/jacoco/html"
105+
}
106+
doLast {
107+
println "Test results available at:"
108+
println "html - $buildDir/reports/tests/html/index.html"
109+
println "Test coverage reports available at:"
110+
println "html - $buildDir/reports/jacoco/html/index.html"
111+
println "xml - $buildDir/reports/jacoco/jacoco.xml"
112+
}
113+
}
114+
115+
javadoc {
116+
source = sourceSets.main.allJava
117+
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PUBLIC
118+
}
119+
120+
task javadocJar(type: Jar, dependsOn: javadoc) {
121+
classifier = 'javadoc'
122+
from 'build/docs/javadoc'
123+
}
124+
125+
task sourcesJar(type: Jar) {
126+
from sourceSets.main.allSource
127+
classifier = 'sources'
128+
}
129+
130+
build.dependsOn("copyLibs");
131+
132+
task copyLibs(type: Copy) {
133+
into "$buildDir/dependencies/"
134+
from configurations.runtime
135+
}
136+
137+
artifacts {
138+
archives jar
139+
archives javadocJar
140+
archives sourcesJar
141+
}

config/Eclipse_Coding_Style.xml

Lines changed: 291 additions & 0 deletions
Large diffs are not rendered by default.

config/checkstyle/checkstyle.xml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
3+
4+
<!--
5+
This configuration file was written by the eclipse-cs plugin configuration editor
6+
-->
7+
<!--
8+
Checkstyle-Configuration: Ambush Checkstyle
9+
Description: none
10+
-->
11+
<module name="Checker">
12+
<property name="severity" value="warning"/>
13+
<module name="TreeWalker">
14+
<module name="AnnotationUseStyle"/>
15+
<module name="MissingDeprecated"/>
16+
<module name="MissingOverride"/>
17+
<module name="PackageAnnotation"/>
18+
<module name="JavadocMethod">
19+
<property name="scope" value="public"/>
20+
<property name="excludeScope" value="protected"/>
21+
<property name="suppressLoadErrors" value="true"/>
22+
</module>
23+
<module name="JavadocStyle"/>
24+
<module name="JavadocType"/>
25+
<module name="JavadocVariable">
26+
<property name="severity" value="ignore"/>
27+
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
28+
</module>
29+
<module name="WriteTag"/>
30+
<module name="MethodName"/>
31+
<module name="MemberName"/>
32+
<module name="ParameterName"/>
33+
<module name="PackageName"/>
34+
<module name="StaticVariableName"/>
35+
<module name="ConstantName"/>
36+
<module name="AbstractClassName">
37+
<property name="severity" value="ignore"/>
38+
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
39+
</module>
40+
<module name="LocalFinalVariableName"/>
41+
<module name="LocalVariableName"/>
42+
<module name="TypeName"/>
43+
<module name="AvoidStarImport"/>
44+
<module name="ImportOrder">
45+
<property name="option" value="above"/>
46+
<property name="separated" value="true"/>
47+
</module>
48+
<module name="RedundantImport"/>
49+
<module name="UnusedImports"/>
50+
<module name="AnonInnerLength">
51+
<property name="max" value="50"/>
52+
</module>
53+
<module name="LineLength">
54+
<property name="max" value="120"/>
55+
<property name="tabWidth" value="2"/>
56+
</module>
57+
<module name="MethodLength"/>
58+
<module name="ParameterNumber">
59+
<property name="max" value="10"/>
60+
</module>
61+
<module name="MethodCount"/>
62+
<module name="GenericWhitespace"/>
63+
<module name="EmptyForInitializerPad"/>
64+
<module name="EmptyForIteratorPad"/>
65+
<module name="RedundantModifier">
66+
<property name="tokens" value="VARIABLE_DEF,ANNOTATION_FIELD_DEF,INTERFACE_DEF"/>
67+
</module>
68+
<module name="NeedBraces"/>
69+
<module name="RightCurly"/>
70+
<module name="EmptyStatement"/>
71+
<module name="EqualsHashCode"/>
72+
<module name="IllegalThrows">
73+
<property name="ignoredMethodNames" value="finalize, call, acceptConsumedItem"/>
74+
</module>
75+
<module name="MissingSwitchDefault"/>
76+
<module name="NoFinalizer">
77+
<property name="severity" value="ignore"/>
78+
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
79+
</module>
80+
<module name="NoClone"/>
81+
<module name="BooleanExpressionComplexity">
82+
<property name="max" value="5"/>
83+
</module>
84+
<module name="TodoComment">
85+
<property name="severity" value="ignore"/>
86+
<property name="format" value="TODO - "/>
87+
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
88+
</module>
89+
<module name="ModifierOrder"/>
90+
</module>
91+
<module name="JavadocPackage"/>
92+
<module name="FileLength"/>
93+
</module>

gradle/wrapper/gradle-wrapper.jar

50.9 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Tue Apr 14 18:53:28 MDT 2015
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-2.3-bin.zip

0 commit comments

Comments
 (0)