From 7d7f2eed87b021ccaba80925b34671e0c483afef Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Sat, 11 Feb 2017 23:53:04 -0600 Subject: [PATCH] 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. --- build.gradle | 103 +++--------------- service/build.gradle | 77 +++++++++++++ .../main/WEB-INF/classes/context.properties | 0 .../WEB-INF/classes/datasource.properties | 0 .../main/WEB-INF/classes/logback.groovy | 0 .../resources}/main/WEB-INF/web.xml | 0 .../resources}/migration/old-songs-db.groovy | 0 .../test/WEB-INF/classes/context.properties | 0 .../WEB-INF/classes/datasource.properties | 0 .../resources}/test/WEB-INF/web.xml | 0 .../resources}/test/testdb.init.sql | 0 .../resources}/webapp/favicon.ico | Bin .../resources}/webapp/favicon.png | Bin .../resources}/webapp/images/favicon.png | Bin .../resources}/webapp/images/favicon.svg | 0 .../webapp/images/new-life-songs.png | Bin .../webapp/images/new-life-songs.svg | 0 .../com/jdbernard/nlsongs/db/NLSongsDB.groovy | 0 .../nlsongs/model/Performance.groovy | 0 .../com/jdbernard/nlsongs/model/Role.java | 0 .../jdbernard/nlsongs/model/Service.groovy | 0 .../jdbernard/nlsongs/model/ServiceType.java | 0 .../com/jdbernard/nlsongs/model/Song.groovy | 0 .../com/jdbernard/nlsongs/model/Token.groovy | 0 .../com/jdbernard/nlsongs/model/User.groovy | 0 .../nlsongs/model/UserCredentials.groovy | 0 .../com/jdbernard/nlsongs/rest/AllowCors.java | 0 .../nlsongs/rest/CorsResponseFilter.java | 0 .../jdbernard/nlsongs/rest/PingResource.java | 0 .../nlsongs/rest/ServicesResource.java | 0 .../jdbernard/nlsongs/rest/SongsResource.java | 0 .../jdbernard/nlsongs/rest/UsersResource.java | 0 .../security/NLSongsSecurityContext.groovy | 0 .../rest/security/SecurityRequestFilter.java | 0 .../nlsongs/rest/security/TokenPrincipal.java | 0 .../nlsongs/servlet/NLSongsContext.groovy | 0 .../servlet/NLSongsContextListener.groovy | 0 .../sql/20170209113022-create-schema-down.sql | 0 .../sql/20170209113022-create-schema-up.sql | 0 .../20170209113258-add-song-sequence-down.sql | 0 .../20170209113258-add-song-sequence-up.sql | 0 .../src}/main/webapp/css/forSize.mixin.scss | 0 .../src}/main/webapp/css/new-life-songs.scss | 0 .../src}/main/webapp/css/reset.scss | 0 .../src}/main/webapp/doc/api/v1/index.html | 0 {src => service/src}/main/webapp/index.html | 0 .../src}/main/webapp/js/new-life-songs.js | 0 .../src}/main/webapp/service/index.gsp | 0 .../src}/main/webapp/services/index.gsp | 0 .../src}/main/webapp/song/index.gsp | 0 .../src}/main/webapp/songs/index.gsp | 0 {src => service/src}/migration/migrate.groovy | 0 .../nlsongs/rest/SongsResourceTest.groovy | 0 .../nlsongs/service/NLSongsDBTest.groovy | 0 .../version.properties | 0 settings.gradle | 1 + uploader/build.gradle | 24 ++++ .../jdbernard/nlsongs/NLSongsUploader.groovy | 37 +++++++ uploader/src/main/resources/icon.png | Bin 0 -> 6343 bytes 59 files changed, 156 insertions(+), 86 deletions(-) create mode 100644 service/build.gradle rename {resources => service/resources}/main/WEB-INF/classes/context.properties (100%) rename {resources => service/resources}/main/WEB-INF/classes/datasource.properties (100%) rename {resources => service/resources}/main/WEB-INF/classes/logback.groovy (100%) rename {resources => service/resources}/main/WEB-INF/web.xml (100%) rename {resources => service/resources}/migration/old-songs-db.groovy (100%) rename {resources => service/resources}/test/WEB-INF/classes/context.properties (100%) rename {resources => service/resources}/test/WEB-INF/classes/datasource.properties (100%) rename {resources => service/resources}/test/WEB-INF/web.xml (100%) rename {resources => service/resources}/test/testdb.init.sql (100%) rename {resources => service/resources}/webapp/favicon.ico (100%) rename {resources => service/resources}/webapp/favicon.png (100%) rename {resources => service/resources}/webapp/images/favicon.png (100%) rename {resources => service/resources}/webapp/images/favicon.svg (100%) rename {resources => service/resources}/webapp/images/new-life-songs.png (100%) rename {resources => service/resources}/webapp/images/new-life-songs.svg (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/db/NLSongsDB.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/Performance.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/Role.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/Service.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/ServiceType.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/Song.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/Token.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/User.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/model/UserCredentials.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/AllowCors.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/CorsResponseFilter.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/PingResource.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/ServicesResource.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/SongsResource.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/UsersResource.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/security/NLSongsSecurityContext.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/security/SecurityRequestFilter.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/rest/security/TokenPrincipal.java (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContext.groovy (100%) rename {src => service/src}/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContextListener.groovy (100%) rename {src => service/src}/main/sql/20170209113022-create-schema-down.sql (100%) rename {src => service/src}/main/sql/20170209113022-create-schema-up.sql (100%) rename {src => service/src}/main/sql/20170209113258-add-song-sequence-down.sql (100%) rename {src => service/src}/main/sql/20170209113258-add-song-sequence-up.sql (100%) rename {src => service/src}/main/webapp/css/forSize.mixin.scss (100%) rename {src => service/src}/main/webapp/css/new-life-songs.scss (100%) rename {src => service/src}/main/webapp/css/reset.scss (100%) rename {src => service/src}/main/webapp/doc/api/v1/index.html (100%) rename {src => service/src}/main/webapp/index.html (100%) rename {src => service/src}/main/webapp/js/new-life-songs.js (100%) rename {src => service/src}/main/webapp/service/index.gsp (100%) rename {src => service/src}/main/webapp/services/index.gsp (100%) rename {src => service/src}/main/webapp/song/index.gsp (100%) rename {src => service/src}/main/webapp/songs/index.gsp (100%) rename {src => service/src}/migration/migrate.groovy (100%) rename {src => service/src}/test/groovy/com/jdbernard/nlsongs/rest/SongsResourceTest.groovy (100%) rename {src => service/src}/test/groovy/com/jdbernard/nlsongs/service/NLSongsDBTest.groovy (100%) rename version.properties => service/version.properties (100%) create mode 100644 settings.gradle create mode 100644 uploader/build.gradle create mode 100644 uploader/src/main/groovy/com/jdbernard/nlsongs/NLSongsUploader.groovy create mode 100644 uploader/src/main/resources/icon.png diff --git a/build.gradle b/build.gradle index 4d9d97f..b98a903 100644 --- a/build.gradle +++ b/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}") -} } diff --git a/service/build.gradle b/service/build.gradle new file mode 100644 index 0000000..3fded9b --- /dev/null +++ b/service/build.gradle @@ -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}") +} } diff --git a/resources/main/WEB-INF/classes/context.properties b/service/resources/main/WEB-INF/classes/context.properties similarity index 100% rename from resources/main/WEB-INF/classes/context.properties rename to service/resources/main/WEB-INF/classes/context.properties diff --git a/resources/main/WEB-INF/classes/datasource.properties b/service/resources/main/WEB-INF/classes/datasource.properties similarity index 100% rename from resources/main/WEB-INF/classes/datasource.properties rename to service/resources/main/WEB-INF/classes/datasource.properties diff --git a/resources/main/WEB-INF/classes/logback.groovy b/service/resources/main/WEB-INF/classes/logback.groovy similarity index 100% rename from resources/main/WEB-INF/classes/logback.groovy rename to service/resources/main/WEB-INF/classes/logback.groovy diff --git a/resources/main/WEB-INF/web.xml b/service/resources/main/WEB-INF/web.xml similarity index 100% rename from resources/main/WEB-INF/web.xml rename to service/resources/main/WEB-INF/web.xml diff --git a/resources/migration/old-songs-db.groovy b/service/resources/migration/old-songs-db.groovy similarity index 100% rename from resources/migration/old-songs-db.groovy rename to service/resources/migration/old-songs-db.groovy diff --git a/resources/test/WEB-INF/classes/context.properties b/service/resources/test/WEB-INF/classes/context.properties similarity index 100% rename from resources/test/WEB-INF/classes/context.properties rename to service/resources/test/WEB-INF/classes/context.properties diff --git a/resources/test/WEB-INF/classes/datasource.properties b/service/resources/test/WEB-INF/classes/datasource.properties similarity index 100% rename from resources/test/WEB-INF/classes/datasource.properties rename to service/resources/test/WEB-INF/classes/datasource.properties diff --git a/resources/test/WEB-INF/web.xml b/service/resources/test/WEB-INF/web.xml similarity index 100% rename from resources/test/WEB-INF/web.xml rename to service/resources/test/WEB-INF/web.xml diff --git a/resources/test/testdb.init.sql b/service/resources/test/testdb.init.sql similarity index 100% rename from resources/test/testdb.init.sql rename to service/resources/test/testdb.init.sql diff --git a/resources/webapp/favicon.ico b/service/resources/webapp/favicon.ico similarity index 100% rename from resources/webapp/favicon.ico rename to service/resources/webapp/favicon.ico diff --git a/resources/webapp/favicon.png b/service/resources/webapp/favicon.png similarity index 100% rename from resources/webapp/favicon.png rename to service/resources/webapp/favicon.png diff --git a/resources/webapp/images/favicon.png b/service/resources/webapp/images/favicon.png similarity index 100% rename from resources/webapp/images/favicon.png rename to service/resources/webapp/images/favicon.png diff --git a/resources/webapp/images/favicon.svg b/service/resources/webapp/images/favicon.svg similarity index 100% rename from resources/webapp/images/favicon.svg rename to service/resources/webapp/images/favicon.svg diff --git a/resources/webapp/images/new-life-songs.png b/service/resources/webapp/images/new-life-songs.png similarity index 100% rename from resources/webapp/images/new-life-songs.png rename to service/resources/webapp/images/new-life-songs.png diff --git a/resources/webapp/images/new-life-songs.svg b/service/resources/webapp/images/new-life-songs.svg similarity index 100% rename from resources/webapp/images/new-life-songs.svg rename to service/resources/webapp/images/new-life-songs.svg diff --git a/src/main/groovy/com/jdbernard/nlsongs/db/NLSongsDB.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/db/NLSongsDB.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/db/NLSongsDB.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/db/NLSongsDB.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/Performance.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/model/Performance.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/Performance.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/model/Performance.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/Role.java b/service/src/main/groovy/com/jdbernard/nlsongs/model/Role.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/Role.java rename to service/src/main/groovy/com/jdbernard/nlsongs/model/Role.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/Service.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/model/Service.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/Service.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/model/Service.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/ServiceType.java b/service/src/main/groovy/com/jdbernard/nlsongs/model/ServiceType.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/ServiceType.java rename to service/src/main/groovy/com/jdbernard/nlsongs/model/ServiceType.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/Song.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/model/Song.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/Song.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/model/Song.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/Token.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/model/Token.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/Token.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/model/Token.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/User.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/model/User.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/User.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/model/User.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/model/UserCredentials.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/model/UserCredentials.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/model/UserCredentials.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/model/UserCredentials.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/AllowCors.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/AllowCors.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/AllowCors.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/AllowCors.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/CorsResponseFilter.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/CorsResponseFilter.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/CorsResponseFilter.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/CorsResponseFilter.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/PingResource.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/PingResource.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/PingResource.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/PingResource.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/ServicesResource.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/ServicesResource.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/ServicesResource.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/ServicesResource.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/SongsResource.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/SongsResource.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/SongsResource.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/SongsResource.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/UsersResource.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/UsersResource.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/UsersResource.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/UsersResource.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/security/NLSongsSecurityContext.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/rest/security/NLSongsSecurityContext.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/security/NLSongsSecurityContext.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/security/NLSongsSecurityContext.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/security/SecurityRequestFilter.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/security/SecurityRequestFilter.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/security/SecurityRequestFilter.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/security/SecurityRequestFilter.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/rest/security/TokenPrincipal.java b/service/src/main/groovy/com/jdbernard/nlsongs/rest/security/TokenPrincipal.java similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/rest/security/TokenPrincipal.java rename to service/src/main/groovy/com/jdbernard/nlsongs/rest/security/TokenPrincipal.java diff --git a/src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContext.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContext.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContext.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContext.groovy diff --git a/src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContextListener.groovy b/service/src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContextListener.groovy similarity index 100% rename from src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContextListener.groovy rename to service/src/main/groovy/com/jdbernard/nlsongs/servlet/NLSongsContextListener.groovy diff --git a/src/main/sql/20170209113022-create-schema-down.sql b/service/src/main/sql/20170209113022-create-schema-down.sql similarity index 100% rename from src/main/sql/20170209113022-create-schema-down.sql rename to service/src/main/sql/20170209113022-create-schema-down.sql diff --git a/src/main/sql/20170209113022-create-schema-up.sql b/service/src/main/sql/20170209113022-create-schema-up.sql similarity index 100% rename from src/main/sql/20170209113022-create-schema-up.sql rename to service/src/main/sql/20170209113022-create-schema-up.sql diff --git a/src/main/sql/20170209113258-add-song-sequence-down.sql b/service/src/main/sql/20170209113258-add-song-sequence-down.sql similarity index 100% rename from src/main/sql/20170209113258-add-song-sequence-down.sql rename to service/src/main/sql/20170209113258-add-song-sequence-down.sql diff --git a/src/main/sql/20170209113258-add-song-sequence-up.sql b/service/src/main/sql/20170209113258-add-song-sequence-up.sql similarity index 100% rename from src/main/sql/20170209113258-add-song-sequence-up.sql rename to service/src/main/sql/20170209113258-add-song-sequence-up.sql diff --git a/src/main/webapp/css/forSize.mixin.scss b/service/src/main/webapp/css/forSize.mixin.scss similarity index 100% rename from src/main/webapp/css/forSize.mixin.scss rename to service/src/main/webapp/css/forSize.mixin.scss diff --git a/src/main/webapp/css/new-life-songs.scss b/service/src/main/webapp/css/new-life-songs.scss similarity index 100% rename from src/main/webapp/css/new-life-songs.scss rename to service/src/main/webapp/css/new-life-songs.scss diff --git a/src/main/webapp/css/reset.scss b/service/src/main/webapp/css/reset.scss similarity index 100% rename from src/main/webapp/css/reset.scss rename to service/src/main/webapp/css/reset.scss diff --git a/src/main/webapp/doc/api/v1/index.html b/service/src/main/webapp/doc/api/v1/index.html similarity index 100% rename from src/main/webapp/doc/api/v1/index.html rename to service/src/main/webapp/doc/api/v1/index.html diff --git a/src/main/webapp/index.html b/service/src/main/webapp/index.html similarity index 100% rename from src/main/webapp/index.html rename to service/src/main/webapp/index.html diff --git a/src/main/webapp/js/new-life-songs.js b/service/src/main/webapp/js/new-life-songs.js similarity index 100% rename from src/main/webapp/js/new-life-songs.js rename to service/src/main/webapp/js/new-life-songs.js diff --git a/src/main/webapp/service/index.gsp b/service/src/main/webapp/service/index.gsp similarity index 100% rename from src/main/webapp/service/index.gsp rename to service/src/main/webapp/service/index.gsp diff --git a/src/main/webapp/services/index.gsp b/service/src/main/webapp/services/index.gsp similarity index 100% rename from src/main/webapp/services/index.gsp rename to service/src/main/webapp/services/index.gsp diff --git a/src/main/webapp/song/index.gsp b/service/src/main/webapp/song/index.gsp similarity index 100% rename from src/main/webapp/song/index.gsp rename to service/src/main/webapp/song/index.gsp diff --git a/src/main/webapp/songs/index.gsp b/service/src/main/webapp/songs/index.gsp similarity index 100% rename from src/main/webapp/songs/index.gsp rename to service/src/main/webapp/songs/index.gsp diff --git a/src/migration/migrate.groovy b/service/src/migration/migrate.groovy similarity index 100% rename from src/migration/migrate.groovy rename to service/src/migration/migrate.groovy diff --git a/src/test/groovy/com/jdbernard/nlsongs/rest/SongsResourceTest.groovy b/service/src/test/groovy/com/jdbernard/nlsongs/rest/SongsResourceTest.groovy similarity index 100% rename from src/test/groovy/com/jdbernard/nlsongs/rest/SongsResourceTest.groovy rename to service/src/test/groovy/com/jdbernard/nlsongs/rest/SongsResourceTest.groovy diff --git a/src/test/groovy/com/jdbernard/nlsongs/service/NLSongsDBTest.groovy b/service/src/test/groovy/com/jdbernard/nlsongs/service/NLSongsDBTest.groovy similarity index 100% rename from src/test/groovy/com/jdbernard/nlsongs/service/NLSongsDBTest.groovy rename to service/src/test/groovy/com/jdbernard/nlsongs/service/NLSongsDBTest.groovy diff --git a/version.properties b/service/version.properties similarity index 100% rename from version.properties rename to service/version.properties diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..73ca814 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include 'service', 'uploader' diff --git a/uploader/build.gradle b/uploader/build.gradle new file mode 100644 index 0000000..2eecd7f --- /dev/null +++ b/uploader/build.gradle @@ -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 diff --git a/uploader/src/main/groovy/com/jdbernard/nlsongs/NLSongsUploader.groovy b/uploader/src/main/groovy/com/jdbernard/nlsongs/NLSongsUploader.groovy new file mode 100644 index 0000000..4d78332 --- /dev/null +++ b/uploader/src/main/groovy/com/jdbernard/nlsongs/NLSongsUploader.groovy @@ -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) { + + } + } + } +} diff --git a/uploader/src/main/resources/icon.png b/uploader/src/main/resources/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..27e921ffd0fd96e63b6029552fe99411c711f0db GIT binary patch literal 6343 zcmW-l1yob-8^`Ykj1dDQrCUlw5d|q{OhUR#MyJ5&hEdX8N=Qi~4FU=b=@gW1Bz`nV zgT(*(KRb8#>^bM|eeVf)z`z#(xUC`g@|lLm z^v)Yk9d+&Lo4MKGxXM&PY_$#wKVEec+F-1SIUg>z`yBLntVI3GJ@E^vW7|@+>lz;! zr^%OMA6kK2W@Z^d8b>}QRijFI!HCzYctv+Pp6jH=?fCfP<59~xIZ(pmPCXAO61;Z@ zpX}{@oALbN&HEf4kle(@;fe2xda!*{7cUasWbUrvOO*?|ve9LIK8olg*|Ec9-@WkQez?IZ|6(k3dpjf|kk zslb%IR;=*fJ*@ovhHano?YF7^1bteQd!Z&c2=a|O@l*>9+nD>;%a2Zf0*pGPRow33 znMlH@fh6~Xk%MC!B>%<*)LV34dzWx^`;k$X84f_kr<0wBf5z&K9TWI?PnORTPD>df z8BtEV+3EyB!C;}Q&uDl^-Iv#Ka*H116O*Kh z$toEJq-yA&Csz$mA(Gyu#OqYF{_28e*0wio3?Id;#C0GTy>r5!_G+c#nCC(#h#b{y2S1nF7cdJ~ppL8`IoO__Z} zy!_Y&`|2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