Skip to content

Commit

Permalink
a bit of restructuring the examples into their own subproject, modern…
Browse files Browse the repository at this point in the history
…izing gradle and a new release to maven central
  • Loading branch information
Trilarion committed Jun 3, 2019
1 parent a26b8ed commit 62f4b7f
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 40 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ Combination and continuation of JOrbis, JavaSPI and Tritonus-Share to provide Og
## Download, License, Feedback

- [Homepage](https://github.com/Trilarion/java-vorbis-support) of java-vorbis-support
- Requires Java 7 or later
- Download [vorbis-support-1.1.0.jar](https://github.com/Trilarion/java-vorbis-support/releases/download/v1.1.0/vorbis-support-1.1.0.jar) (released 15th July 2015) and/or [source code](https://github.com/Trilarion/java-vorbis-support/releases/tag/v1.1.0)
- Requires Java 9 or later
- Download [vorbis-support-1.2.0.jar](https://github.com/Trilarion/java-vorbis-support/releases/download/v1.2.0/vorbis-support-1.2.0.jar) (released 4th June 2019) and/or [source code](https://github.com/Trilarion/java-vorbis-support/releases/tag/v1.2.0)
- License is [LGPLv3+](http://www.gnu.org/licenses/lgpl-3.0.txt)
- Support/Feedback: Create an [issue](https://github.com/Trilarion/java-vorbis-support/issues)

On Maven Central:
- [vorbis-support 1.0.0](https://search.maven.org/#artifactdetails%7Ccom.github.trilarion%7Cvorbis-support%7C1.0.0%7Cjar) licensed under LGPLv2+
- [java-vorbis-support 1.2.0](https://search.maven.org/#artifactdetails%7Ccom.github.trilarion%7Cvorbis-support%7C1.2.0%7Cjar) licensed under LGPLv3+
- [vorbis-support 1.1.0](https://search.maven.org/#artifactdetails%7Ccom.github.trilarion%7Cvorbis-support%7C1.1.0%7Cjar) licensed under LGPLv3+
- [vorbis-support 1.0.0](https://search.maven.org/#artifactdetails%7Ccom.github.trilarion%7Cvorbis-support%7C1.0.0%7Cjar) licensed under LGPLv2+

## Introduction

Expand Down Expand Up @@ -78,7 +79,11 @@ and access your sound resources (SourceDataLine or Clip) as you would without Og
}
} catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) {
// failed
}
}

Run an example with

./gradlew run :examples:run

## Alternatives

Expand Down
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
repositories {
mavenCentral()
}
}
32 changes: 32 additions & 0 deletions examples/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
id 'java'
}

sourceCompatibility = 1.9
targetCompatibility = 1.9

dependencies {
// implementation project(':vorbis-support')
implementation 'com.github.trilarion:vorbis-support:1.1.0'
}

ext.mainClass = 'com.github.trilarion.vorbis.jcraft.OggPlayer'

task run(dependsOn: classes, type: JavaExec) {
if (project.hasProperty('mainClass')) {
main = mainClass
}
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = sourceSets.main.output.resourcesDir
}

task debug(dependsOn: classes, type: JavaExec) {
if (project.hasProperty('mainClass')) {
main = mainClass
}
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = sourceSets.main.output.resourcesDir
debug = true
}
Binary file added examples/src/main/resources/Agogo.ogg
Binary file not shown.
1 change: 1 addition & 0 deletions examples/src/main/resources/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Agogo.ogg: Public Domain (http://commons.wikimedia.org/wiki/File:Agogo.ogg)
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rootProject.name = 'sound'

include ':vorbis-support',':examples'
36 changes: 0 additions & 36 deletions vorbis-support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,8 @@ archivesBaseName = 'java-vorbis-support'
sourceCompatibility = 1.9
targetCompatibility = 1.9

repositories {
mavenCentral()
}

sourceSets {
examples
}

dependencies {
testImplementation 'junit:junit:4.12'
examplesImplementation sourceSets.main.output
}

allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}

task run(dependsOn: classes, type: JavaExec) {
if (project.hasProperty('mainClass')) {
main = mainClass
}
classpath = sourceSets.main.runtimeClasspath + sourceSets.examples.runtimeClasspath
standardInput = System.in
workingDir = sourceSets.test.output.resourcesDir
}

task debug(dependsOn: classes, type: JavaExec) {
if (project.hasProperty('mainClass')) {
main = mainClass
}
classpath = sourceSets.main.runtimeClasspath + sourceSets.examples.runtimeClasspath
standardInput = System.in
workingDir = sourceSets.test.output.resourcesDir
debug = true
}

if (!sourceSets.test.output.resourcesDir.exists()) {
Expand Down

0 comments on commit 62f4b7f

Please sign in to comment.