Re-organized into two submodules: service and uploader.
Moved all the existing service code into the `service` submodule. Stubbed out project and GUI frame for the uploader. Idea is to have a GUI that infers all the correct meta-data from media tag values and creates service, songs, and performance records appropriately based on the tagged mp3/ogg files of the performances.
103
build.gradle
@ -1,93 +1,24 @@
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url 'https://mvn.jdb-labs.com/repo' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.jdbernard:gradle-exec-util:0.2.0'
|
||||
}
|
||||
}
|
||||
|
||||
plugins { id 'com.palantir.git-version' version '0.5.2' }
|
||||
|
||||
apply plugin: "groovy"
|
||||
apply plugin: "maven"
|
||||
apply plugin: "war"
|
||||
allprojects {
|
||||
group = "com.jdbernard"
|
||||
|
||||
group = "com.jdbernard"
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven { url 'https://mvn.jdb-labs.com/repo' }
|
||||
}
|
||||
}
|
||||
|
||||
import static com.jdbernard.gradle.ExecUtil.*
|
||||
|
||||
version = gitVersion()
|
||||
|
||||
// webAppDirName = "build/webapp/main"
|
||||
|
||||
repositories {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven { url "https://mvn.jdb-labs.com/repo" }
|
||||
}
|
||||
|
||||
apply plugin: 'com.palantir.git-version'
|
||||
version = gitVersion()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'ch.qos.logback:logback-classic:1.1.8'
|
||||
compile 'ch.qos.logback:logback-core:1.1.8'
|
||||
compile 'com.impossibl.pgjdbc-ng:pgjdbc-ng:0.6'
|
||||
compile 'com.lambdaworks:scrypt:1.4.0'
|
||||
compile 'com.zaxxer:HikariCP:2.5.1'
|
||||
compile 'javax:javaee-api:7.0'
|
||||
compile 'javax.ws.rs:javax.ws.rs-api:2.0.1'
|
||||
compile 'joda-time:joda-time:2.7'
|
||||
compile 'org.codehaus.groovy:groovy-all:2.4.7'
|
||||
compile 'org.slf4j:slf4j-api:1.7.22'
|
||||
runtime 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.3.2'
|
||||
runtime 'org.glassfish.jersey.containers:jersey-container-servlet:2.16'
|
||||
runtime 'org.glassfish.jersey.media:jersey-media-json-jackson:2.16'
|
||||
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile 'com.jdblabs:db-migrate.groovy:0.2.5'
|
||||
testRuntime 'com.h2database:h2:1.4.186'
|
||||
}
|
||||
|
||||
war {
|
||||
from "resources/webapp"
|
||||
from "build/webapp"
|
||||
filter(ReplaceTokens, tokens: [version: version])
|
||||
rename '(.+)(\\..*(css|js))', '$1-' + version + '$2'
|
||||
webInf { from 'resources/main/WEB-INF' }
|
||||
exclude "**/.*.swp", "**/.sass-cache"
|
||||
}
|
||||
|
||||
test { testLogging { events 'failed' } }
|
||||
|
||||
task testWar(type: War) {
|
||||
from 'resources/webapp'
|
||||
filter(ReplaceTokens, tokens: [version: version])
|
||||
rename '(.+)(\\..*(css|js))', '$1-' + version + '$2'
|
||||
webInf { from 'resources/test/WEB-INF' }
|
||||
classifier 'test' }
|
||||
|
||||
task compileScss(
|
||||
group: 'build',
|
||||
description: 'Compile SCSS files into CSS.',
|
||||
type: Exec
|
||||
) {
|
||||
executable "scss"
|
||||
args "--update", "src/main/webapp/css:build/webapp/css"
|
||||
}
|
||||
|
||||
war.dependsOn compileScss
|
||||
testWar.dependsOn compileScss
|
||||
|
||||
task deployProd(dependsOn: ['build']) { doLast {
|
||||
def warName = "${project.name}-${version}.war"
|
||||
def artifactName = "ROOT.war"
|
||||
|
||||
copy {
|
||||
from "build/libs"
|
||||
into "build"
|
||||
include warName
|
||||
rename warName, artifactName }
|
||||
|
||||
exec("eb", "deploy", "-l", "${project.name}-${version}")
|
||||
} }
|
||||
|
77
service/build.gradle
Normal file
@ -0,0 +1,77 @@
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
apply plugin: "groovy"
|
||||
apply plugin: "maven"
|
||||
apply plugin: "war"
|
||||
|
||||
// webAppDirName = "build/webapp/main"
|
||||
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath 'com.jdbernard:gradle-exec-util:0.2.0'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile localGroovy()
|
||||
compile 'ch.qos.logback:logback-classic:1.1.8'
|
||||
compile 'ch.qos.logback:logback-core:1.1.8'
|
||||
compile 'org.slf4j:slf4j-api:1.7.22'
|
||||
compile 'com.impossibl.pgjdbc-ng:pgjdbc-ng:0.6'
|
||||
compile 'com.lambdaworks:scrypt:1.4.0'
|
||||
compile 'com.zaxxer:HikariCP:2.5.1'
|
||||
compile 'javax:javaee-api:7.0'
|
||||
compile 'javax.ws.rs:javax.ws.rs-api:2.0.1'
|
||||
compile 'joda-time:joda-time:2.7'
|
||||
runtime 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.3.2'
|
||||
runtime 'org.glassfish.jersey.containers:jersey-container-servlet:2.16'
|
||||
runtime 'org.glassfish.jersey.media:jersey-media-json-jackson:2.16'
|
||||
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile 'com.jdblabs:db-migrate.groovy:0.2.5'
|
||||
testRuntime 'com.h2database:h2:1.4.186'
|
||||
}
|
||||
|
||||
war {
|
||||
from "resources/webapp"
|
||||
from "build/webapp"
|
||||
filter(ReplaceTokens, tokens: [version: version])
|
||||
rename '(.+)(\\..*(css|js))', '$1-' + version + '$2'
|
||||
webInf { from 'resources/main/WEB-INF' }
|
||||
exclude "**/.*.swp", "**/.sass-cache"
|
||||
}
|
||||
|
||||
test { testLogging { events 'failed' } }
|
||||
|
||||
task testWar(type: War) {
|
||||
from 'resources/webapp'
|
||||
filter(ReplaceTokens, tokens: [version: version])
|
||||
rename '(.+)(\\..*(css|js))', '$1-' + version + '$2'
|
||||
webInf { from 'resources/test/WEB-INF' }
|
||||
classifier 'test' }
|
||||
|
||||
task compileScss(
|
||||
group: 'build',
|
||||
description: 'Compile SCSS files into CSS.',
|
||||
type: Exec
|
||||
) {
|
||||
executable "scss"
|
||||
args "--update", "src/main/webapp/css:build/webapp/css"
|
||||
}
|
||||
|
||||
war.dependsOn compileScss
|
||||
testWar.dependsOn compileScss
|
||||
|
||||
task deployProd(dependsOn: ['build']) { doLast {
|
||||
def warName = "${project.name}-${version}.war"
|
||||
def artifactName = "ROOT.war"
|
||||
|
||||
copy {
|
||||
from "build/libs"
|
||||
into "build"
|
||||
include warName
|
||||
rename warName, artifactName }
|
||||
|
||||
exec("eb", "deploy", "-l", "${parent.name}-${project.name}-${version}")
|
||||
} }
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
1
settings.gradle
Normal file
@ -0,0 +1 @@
|
||||
include 'service', 'uploader'
|
24
uploader/build.gradle
Normal file
@ -0,0 +1,24 @@
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName = 'com.jdbernard.nlsongs.NLSongsUploader'
|
||||
|
||||
dependencies {
|
||||
compile localGroovy()
|
||||
compile 'ch.qos.logback:logback-classic:1.1.8'
|
||||
compile 'ch.qos.logback:logback-core:1.1.8'
|
||||
compile 'org.slf4j:slf4j-api:1.7.22'
|
||||
compile 'com.impossibl.pgjdbc-ng:pgjdbc-ng:0.6'
|
||||
compile 'com.zaxxer:HikariCP:2.5.1'
|
||||
compile 'com.miglayout:miglayout-swing:5.0'
|
||||
compile project(':service')
|
||||
}
|
||||
|
||||
task writeVersionFile(
|
||||
group: 'build',
|
||||
description: 'Write the version to VERSION.txt') { doLast {
|
||||
|
||||
(new File('build/classes/main/VERSION.txt')).text = version
|
||||
} }
|
||||
|
||||
build.dependsOn writeVersionFile
|
@ -0,0 +1,37 @@
|
||||
package com.jdbernard.nlsongs
|
||||
|
||||
import groovy.beans.Bindable
|
||||
import groovy.swing.SwingBuilder
|
||||
import javax.swing.JFrame
|
||||
import net.miginfocom.swing.MigLayout
|
||||
|
||||
public class NLSongsUploader {
|
||||
|
||||
public static final String VERSION =
|
||||
NLSongsUploader.getResourceAsStream('/VERSION.txt').text
|
||||
|
||||
// GUI Elements (View)
|
||||
SwingBuilder swing = new SwingBuilder()
|
||||
JFrame rootFrame
|
||||
|
||||
public static void main(String[] args) { def inst = new NLSongsUploader() }
|
||||
|
||||
public NLSongsUploader() {
|
||||
|
||||
initGui()
|
||||
rootFrame.show()
|
||||
}
|
||||
|
||||
private void initGui() {
|
||||
|
||||
swing.edtBuilder {
|
||||
this.rootFrame = frame(title: "New Life Songs Uploader ${VERSION}",
|
||||
iconImages: [imageIcon('/icon.png').image],
|
||||
preferredSize: [1024, 768], pack: true,
|
||||
layout: new MigLayout("ins 0, fill"),
|
||||
defaultCloseOperation: JFrame.EXIT_ON_CLOSE) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
uploader/src/main/resources/icon.png
Normal file
After Width: | Height: | Size: 6.2 KiB |