-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Gradle Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
submodules: true | ||
- name: Set up JDK 13 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- name: Test with Gradle | ||
run: ./gradlew --no-daemon test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gradle/ | ||
build/ | ||
out/ | ||
**.zip |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# toc | ||
toc is a command line tool for working with **T**able **o**f **C**ontents files found in the game Star Wars Galaxies. | ||
|
||
A toc file describes which tre file contains which files, such as iff, stf... | ||
|
||
It's basically a lookup table, hence the name Table of Contents. | ||
|
||
## Installation | ||
The tool requires Java SE 13 or newer. | ||
|
||
You can download the tool under Releases. | ||
|
||
### Globally available in shells | ||
```shell script | ||
$ sudo ln -s /path/to/toc.sh /usr/bin/toc | ||
``` | ||
|
||
## Examples | ||
Here are some examples of use cases for the tool. | ||
|
||
### Searching for a file | ||
We'll search for a file named something along the lines of transport_arriving.snd in sku0_client.toc. | ||
```shell script | ||
$ toc -i sku0_client.toc -p | grep "transport_arriving.snd" | ||
voice/sound/voice_starport_transport_arriving.snd@bottom.tre | ||
``` | ||
|
||
### Counting amount of entries in a toc file | ||
We want to know how many files are in sku0_client.toc | ||
```shell script | ||
$ toc -i sku0_client.toc -p | wc -l | ||
193475 | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
plugins { | ||
id 'groovy' | ||
id 'application' | ||
} | ||
|
||
group 'dk.madsboddum' | ||
version '0.0.1' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'org.codehaus.groovy:groovy-all:3.0.3' | ||
|
||
// https://mvnrepository.com/artifact/commons-cli/commons-cli | ||
compile group: 'commons-cli', name: 'commons-cli', version: '1.4' | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.1' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.1' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
def jarFile = project.name + ".jar" | ||
|
||
jar { | ||
// Write app version to version.properties | ||
def properties = new Properties() | ||
properties.setProperty("version", version) | ||
properties.store(new FileOutputStream("src/main/resources/version.properties"), "This file is autogenerated by Gradle") | ||
|
||
manifest { | ||
attributes 'Main-Class': 'dk.madsboddum.toc.Application' | ||
} | ||
|
||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } | ||
|
||
archiveFileName.set(jarFile) | ||
} | ||
|
||
|
||
task distribute(type: Zip) { | ||
dependsOn 'jar' | ||
|
||
// Copy the shell script into the libs folder so it'll be included in the zip file | ||
copy { | ||
from file("toc.sh") | ||
into file("$buildDir/libs/") | ||
} | ||
|
||
// Create a zip file. Example: toc-0.0.1.zip | ||
from 'build/libs' | ||
include '**/*' | ||
archiveName = project.name + "-" + version + ".zip" | ||
destinationDir(file('.')) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |