Skip to content

Commit 4345a63

Browse files
author
Matthias Gaertner
committed
Add Gradle build support for one-step build-from-source. See gradle.org
1 parent 40ed583 commit 4345a63

11 files changed

Lines changed: 421 additions & 10 deletions

File tree

.classpath

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src">
4+
<attributes>
5+
<attribute name="FROM_GRADLE_MODEL" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
9+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
10+
<classpathentry kind="output" path="build/classes/main"/>
11+
</classpath>

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.gradle
2+
build
3+
gradle
4+

.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>StackMatGen3TimerAPI</name>
4+
<comment>Project StackMatGen3TimerAPI created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
21+
<nature>org.eclipse.jdt.core.javanature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build.commands=org.eclipse.jdt.core.javabuilder
2+
connection.arguments=
3+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4+
connection.gradle.user.home=null
5+
connection.java.home=null
6+
connection.jvm.arguments=
7+
connection.project.dir=
8+
derived.resources=.gradle,build
9+
eclipse.preferences.version=1
10+
natures=org.eclipse.jdt.core.javanature
11+
project.path=\:

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,54 @@ For illustration, here is a plot of how "6.189" gets communicated as "S-006189-X
2323

2424
Happy cubing!
2525

26+
## Trying it out with the YuXin Timer
27+
28+
1. You need Java.
29+
- Any Java version should be OK (6,7,8).
30+
1. Open a command line (CMD.EXE, Bash)
31+
- Change to some working directory
32+
- Check Java installation: `java -version` - this should show that Java is available.
33+
- Download this repo/branch: `git clone --branch YuxinDocAmendment https://github.com/m9aertner/StackMatGen3TimerAPI.git`
34+
- Change into the downloaded code: `cd StackMatGen3TimerAPI`
35+
1. Build using [Gradle](http://gradle.org): `./gradlew build`
36+
- This downloads Gradle (once),
37+
- then builds the application's code and JAR file.
38+
- Result is a JAR file: `build/libs/StackMatGen3TimerAPI.jar`
39+
1. Execution
40+
- Connect the timer with to your computer's Mic port (pink 3.5 mm TRS)
41+
- Execute: `java -jar build/libs/StackMatGen3TimerAPI.jar`
42+
- This JAR is executable via `Main-Class` entry in `META-INF/MANIFEST.MF`
43+
- It feels a bit odd, but *no parameters* are supported. The Mixer `#5` is hard-coded. That works for me, not sure what that *magic constant* means.
44+
- The app initializes, then waits for data from the timer. Any data recieved is decoded and shown on each _change_.
45+
- As an example, here's how I start the app, then start the timer (Power button), start a solve, stop at 1s577, reset back to 0m00s000, and finally press Enter to quit.
46+
47+
StackMatGen3TimerAPI> java -jar build\libs\StackMatGen3TimerAPI.jar
48+
Apr 12, 2017 9:06:47 PM au.com.emc.cubing.stackmat.StackmatManager start
49+
INFORMATION: Starting Stackmat gen 3 manager
50+
Apr 12, 2017 9:06:47 PM au.com.emc.cubing.stackmat.StackmatInterpreter initialize
51+
INFORMATION: Initialising stackmat gen 3 interpreter
52+
Apr 12, 2017 9:06:47 PM au.com.emc.cubing.stackmat.StackmatInterpreter doInBackground
53+
INFORMATION: Starting Stackmat background thread
54+
Apr 12, 2017 9:06:47 PM au.com.emc.cubing.stackmat.Main main
55+
INFORMATION: Press Enter to continue...
56+
0:00:000
57+
0:00:068
58+
0:00:197
59+
0:00:326
60+
0:00:455
61+
0:00:584
62+
0:00:713
63+
0:00:842
64+
0:00:971
65+
0:01:100
66+
0:01:220
67+
0:01:349
68+
0:01:478
69+
0:01:577
70+
0:00:000
71+
72+
Apr 12, 2017 9:06:59 PM au.com.emc.cubing.stackmat.Main main
73+
INFORMATION: Stopping manager...
74+
Apr 12, 2017 9:06:59 PM au.com.emc.cubing.stackmat.StackmatManager stop
75+
INFORMATION: Stopping Stackmat gen 3 manager
76+

bin/StackmatGen3TimerAPI.jar

-29.4 KB
Binary file not shown.

build.gradle

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Simple Gradle file to build StackMatGen3TimerAPI.
2+
//
3+
// Gradle can auto-install itself. See https://docs.gradle.org/current/userguide/gradle_wrapper.html
4+
// Just call
5+
//
6+
// ./gradlew build
7+
//
8+
// to build. The result JAR file will be in
9+
//
10+
// build/libs/StackMatGen3TimerAPI.jar
11+
//
12+
// To run, call
13+
//
14+
// java -jar build/libs/StackMatGen3TimerAPI.jar
15+
//
16+
// This assumes java is in the PATH. Check using
17+
//
18+
// java -version
19+
//
20+
21+
apply plugin: 'java'
22+
23+
sourceSets {
24+
main {
25+
java {
26+
srcDirs = ['src'] // Non-standard source folder. Default is src/main/java.
27+
}
28+
}
29+
}
30+
31+
jar {
32+
manifest {
33+
attributes 'Main-Class': 'au.com.emc.cubing.stackmat.Main'
34+
}
35+
}
36+
37+
// Load/install the wrapper. This is done once and the result is
38+
// committed to version control. You do not need to call this.
39+
task wrapper(type: Wrapper) {
40+
gradleVersion = '3.5'
41+
}
42+

gradlew

Lines changed: 169 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)