diff --git a/.gitignore b/.gitignore index fe3142a..bac0a6c 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,7 @@ nbdist/ package-lock.json package.json webpack.config.js -webpack.generated.js \ No newline at end of file +webpack.generated.js + +### Maven ### +**/target \ No newline at end of file diff --git a/acrarium/pom.groovy b/acrarium/pom.groovy new file mode 100644 index 0000000..284bc05 --- /dev/null +++ b/acrarium/pom.groovy @@ -0,0 +1,293 @@ +/* + * (C) Copyright 2019 Lukas Morawietz (https://github.com/F43nd1r) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +project { + modelVersion '4.0.0' + groupId 'com.faendir' + artifactId 'acrarium' + version '0.9.0-SNAPSHOT' + name 'Acrarium' + packaging 'war' + + properties { + 'maven.compiler.source' '1.8' + 'maven.compiler.target' '1.8' + 'project.build.sourceEncoding' 'UTF-8' + 'project.reporting.outputEncoding' 'UTF-8' + 'drivers.dir' '${project.basedir}/drivers' + 'drivers.downloader.phase' 'pre-integration-test' + 'vaadin.version' '14.0.4' + 'querydsl.version' '4.2.1' + } + + parent { + groupId 'org.springframework.boot' + artifactId 'spring-boot-starter-parent' + version '2.1.8.RELEASE' + } + + pluginRepositories { + pluginRepository { + id 'central' + url 'https://repo1.maven.org/maven2/' + snapshots { + enabled false + } + } + } + + repositories { + repository { + id 'central' + url 'https://repo1.maven.org/maven2/' + snapshots { + enabled false + } + } + repository { + id 'Vaadin Directory' + url 'https://maven.vaadin.com/vaadin-addons' + snapshots { + enabled false + } + } + repository { + id 'Google' + url 'https://maven.google.com' + snapshots { + enabled false + } + } + repository { + id 'jcenter' + url 'https://jcenter.bintray.com' + snapshots { + enabled false + } + } + /*repository { + id 'maven.oracle.com' + url 'https://maven.oracle.com' + layout 'default' + snapshots { + enabled false + } + }*/ + } + + dependencyManagement { + dependencies { + dependency { + groupId 'com.vaadin' + artifactId 'vaadin-bom' + version '${vaadin.version}' + type 'pom' + scope 'import' + } + } + } + + dependencies { + dependency { + groupId 'com.vaadin' + artifactId 'vaadin' + exclusions { + exclusion { + artifactId '*' + groupId 'com.vaadin.webjar' + } + exclusion { + artifactId '*' + groupId 'org.webjars.bowergithub.insites' + } + exclusion { + artifactId '*' + groupId 'org.webjars.bowergithub.polymer' + } + exclusion { + artifactId '*' + groupId 'org.webjars.bowergithub.polymerelements' + } + exclusion { + artifactId '*' + groupId 'org.webjars.bowergithub.vaadin' + } + exclusion { + artifactId '*' + groupId 'org.webjars.bowergithub.webcomponents' + } + } + } + dependency { + groupId 'com.vaadin' + artifactId 'vaadin-spring-boot-starter' + exclusions { + exclusion { + artifactId 'vaadin-core' + groupId 'com.vaadin' + } + } + } + dependency 'org.springframework.boot:spring-boot-starter-data-jpa' + dependency 'mysql:mysql-connector-java' + dependency 'org.springframework.boot:spring-boot-starter-security' + dependency 'org.springframework.boot:spring-boot-starter-mail' + dependency 'org.liquibase:liquibase-core' + dependency 'org.yaml:snakeyaml' + dependency 'com.querydsl:querydsl-jpa:${querydsl.version}' + dependency 'com.querydsl:querydsl-sql:${querydsl.version}' + dependency 'com.querydsl:querydsl-apt:${querydsl.version}:provided' + dependency 'org.jfree:jfreechart:1.5.0' + dependency 'org.apache.xmlgraphics:batik-svggen:1.10' + dependency 'ch.acra:acra-javacore:5.3.0' + dependency 'com.faendir.vaadin:jfreechart-flow:1.1.6' + dependency 'org.codeartisans:org.json:20161124' + dependency 'org.apache.commons:commons-text:1.6' + dependency 'commons-io:commons-io:2.5' + dependency 'org.xbib:time:1.0.0' + dependency 'com.faendir.proguard:retrace:1.3' + dependency 'javax.xml.bind:jaxb-api:2.3.1' + dependency 'com.github.ziplet:ziplet:2.3.0' + dependency 'me.xdrop:fuzzywuzzy:1.2.0' + dependency 'com.talanlabs:avatar-generator:1.1.0' + dependency 'org.ektorp:org.ektorp.spring:1.5.0' + dependency 'com.github.appreciated:apexcharts:2.0.0.beta4' + dependency 'javax.servlet:javax.servlet-api:4.0.1' + dependency { + groupId 'org.springframework.boot' + artifactId 'spring-boot-starter-test' + scope 'test' + } + dependency { + groupId 'org.springframework.security' + artifactId 'spring-security-test' + scope 'test' + } + dependency { + groupId 'com.h2database' + artifactId 'h2' + scope 'test' + } + /*dependency { + groupId 'com.oracle.weblogic' + artifactId 'ojdbc7' + version '12.1.3-0-0' + scope 'test' + }*/ + } + + build { + defaultGoal 'spring-boot:run' + plugins { + plugin { + groupId 'org.springframework.boot' + artifactId 'spring-boot-maven-plugin' + } + plugin { + groupId 'com.vaadin' + artifactId 'vaadin-maven-plugin' + version '${vaadin.version}' + executions { + execution { + goals { + goal 'prepare-frontend' + } + } + } + } + plugin { + groupId 'com.mysema.maven' + artifactId 'apt-maven-plugin' + version '1.1.3' + executions { + execution { + goals 'process' + configuration { + outputDirectory '${project.build.directory}/generated-sources/java' + processor 'com.querydsl.apt.jpa.JPAAnnotationProcessor' + } + } + } + } + plugin { + groupId 'org.codehaus.mojo' + artifactId 'build-helper-maven-plugin' + executions { + execution { + id 'add-source' + phase 'generate-sources' + goals 'add-source' + configuration { + sources { + source '${project.build.directory}/generated-sources/java' + } + } + } + } + } + plugin { + groupId 'com.faendir' + artifactId 'message-generator-maven-plugin' + executions { + execution { + goals 'generate' + } + } + configuration { + inputDirectory 'src/main/resources/i18n' + packageName 'com.faendir.acra.i18n' + } + } + } + } + + profiles { + profile { + id 'production' + build { + plugins { + plugin { + groupId 'org.springframework.boot' + artifactId 'spring-boot-maven-plugin' + configuration { + jvmArguments '-Dvaadin.productionMode' + } + } + plugin { + groupId 'com.vaadin' + artifactId 'vaadin-maven-plugin' + executions { + execution { + phase 'compile' + goals { + goal 'build-frontend' + } + } + } + } + } + } + properties { + 'vaadin.productionMode' 'true' + } + dependencies { + dependency { + groupId 'com.vaadin' + artifactId 'flow-server-production-mode' + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/faendir/acra/BackendApplication.java b/acrarium/src/main/java/com/faendir/acra/BackendApplication.java similarity index 100% rename from src/main/java/com/faendir/acra/BackendApplication.java rename to acrarium/src/main/java/com/faendir/acra/BackendApplication.java diff --git a/src/main/java/com/faendir/acra/dataprovider/QueryDslDataProvider.java b/acrarium/src/main/java/com/faendir/acra/dataprovider/QueryDslDataProvider.java similarity index 100% rename from src/main/java/com/faendir/acra/dataprovider/QueryDslDataProvider.java rename to acrarium/src/main/java/com/faendir/acra/dataprovider/QueryDslDataProvider.java diff --git a/src/main/java/com/faendir/acra/i18n/I18NConfiguration.java b/acrarium/src/main/java/com/faendir/acra/i18n/I18NConfiguration.java similarity index 100% rename from src/main/java/com/faendir/acra/i18n/I18NConfiguration.java rename to acrarium/src/main/java/com/faendir/acra/i18n/I18NConfiguration.java diff --git a/src/main/java/com/faendir/acra/i18n/ResourceBundleI18NProvider.java b/acrarium/src/main/java/com/faendir/acra/i18n/ResourceBundleI18NProvider.java similarity index 100% rename from src/main/java/com/faendir/acra/i18n/ResourceBundleI18NProvider.java rename to acrarium/src/main/java/com/faendir/acra/i18n/ResourceBundleI18NProvider.java diff --git a/src/main/java/com/faendir/acra/liquibase/ChangeAwareSpringLiquibase.java b/acrarium/src/main/java/com/faendir/acra/liquibase/ChangeAwareSpringLiquibase.java similarity index 100% rename from src/main/java/com/faendir/acra/liquibase/ChangeAwareSpringLiquibase.java rename to acrarium/src/main/java/com/faendir/acra/liquibase/ChangeAwareSpringLiquibase.java diff --git a/src/main/java/com/faendir/acra/liquibase/LiquibaseChangePostProcessor.java b/acrarium/src/main/java/com/faendir/acra/liquibase/LiquibaseChangePostProcessor.java similarity index 100% rename from src/main/java/com/faendir/acra/liquibase/LiquibaseChangePostProcessor.java rename to acrarium/src/main/java/com/faendir/acra/liquibase/LiquibaseChangePostProcessor.java diff --git a/src/main/java/com/faendir/acra/liquibase/change/BaseChange.java b/acrarium/src/main/java/com/faendir/acra/liquibase/change/BaseChange.java similarity index 100% rename from src/main/java/com/faendir/acra/liquibase/change/BaseChange.java rename to acrarium/src/main/java/com/faendir/acra/liquibase/change/BaseChange.java diff --git a/src/main/java/com/faendir/acra/liquibase/change/ReportColumnsChange.java b/acrarium/src/main/java/com/faendir/acra/liquibase/change/ReportColumnsChange.java similarity index 100% rename from src/main/java/com/faendir/acra/liquibase/change/ReportColumnsChange.java rename to acrarium/src/main/java/com/faendir/acra/liquibase/change/ReportColumnsChange.java diff --git a/src/main/java/com/faendir/acra/liquibase/change/StacktraceChange.java b/acrarium/src/main/java/com/faendir/acra/liquibase/change/StacktraceChange.java similarity index 100% rename from src/main/java/com/faendir/acra/liquibase/change/StacktraceChange.java rename to acrarium/src/main/java/com/faendir/acra/liquibase/change/StacktraceChange.java diff --git a/src/main/java/com/faendir/acra/liquibase/change/VersionChange.java b/acrarium/src/main/java/com/faendir/acra/liquibase/change/VersionChange.java similarity index 100% rename from src/main/java/com/faendir/acra/liquibase/change/VersionChange.java rename to acrarium/src/main/java/com/faendir/acra/liquibase/change/VersionChange.java diff --git a/src/main/java/com/faendir/acra/model/App.java b/acrarium/src/main/java/com/faendir/acra/model/App.java similarity index 100% rename from src/main/java/com/faendir/acra/model/App.java rename to acrarium/src/main/java/com/faendir/acra/model/App.java diff --git a/src/main/java/com/faendir/acra/model/Attachment.java b/acrarium/src/main/java/com/faendir/acra/model/Attachment.java similarity index 100% rename from src/main/java/com/faendir/acra/model/Attachment.java rename to acrarium/src/main/java/com/faendir/acra/model/Attachment.java diff --git a/src/main/java/com/faendir/acra/model/Bug.java b/acrarium/src/main/java/com/faendir/acra/model/Bug.java similarity index 100% rename from src/main/java/com/faendir/acra/model/Bug.java rename to acrarium/src/main/java/com/faendir/acra/model/Bug.java diff --git a/src/main/java/com/faendir/acra/model/MailSettings.java b/acrarium/src/main/java/com/faendir/acra/model/MailSettings.java similarity index 100% rename from src/main/java/com/faendir/acra/model/MailSettings.java rename to acrarium/src/main/java/com/faendir/acra/model/MailSettings.java diff --git a/src/main/java/com/faendir/acra/model/Permission.java b/acrarium/src/main/java/com/faendir/acra/model/Permission.java similarity index 100% rename from src/main/java/com/faendir/acra/model/Permission.java rename to acrarium/src/main/java/com/faendir/acra/model/Permission.java diff --git a/src/main/java/com/faendir/acra/model/Report.java b/acrarium/src/main/java/com/faendir/acra/model/Report.java similarity index 100% rename from src/main/java/com/faendir/acra/model/Report.java rename to acrarium/src/main/java/com/faendir/acra/model/Report.java diff --git a/src/main/java/com/faendir/acra/model/Stacktrace.java b/acrarium/src/main/java/com/faendir/acra/model/Stacktrace.java similarity index 100% rename from src/main/java/com/faendir/acra/model/Stacktrace.java rename to acrarium/src/main/java/com/faendir/acra/model/Stacktrace.java diff --git a/src/main/java/com/faendir/acra/model/StacktraceMatch.java b/acrarium/src/main/java/com/faendir/acra/model/StacktraceMatch.java similarity index 100% rename from src/main/java/com/faendir/acra/model/StacktraceMatch.java rename to acrarium/src/main/java/com/faendir/acra/model/StacktraceMatch.java diff --git a/src/main/java/com/faendir/acra/model/User.java b/acrarium/src/main/java/com/faendir/acra/model/User.java similarity index 100% rename from src/main/java/com/faendir/acra/model/User.java rename to acrarium/src/main/java/com/faendir/acra/model/User.java diff --git a/src/main/java/com/faendir/acra/model/Version.java b/acrarium/src/main/java/com/faendir/acra/model/Version.java similarity index 100% rename from src/main/java/com/faendir/acra/model/Version.java rename to acrarium/src/main/java/com/faendir/acra/model/Version.java diff --git a/src/main/java/com/faendir/acra/model/view/Queries.java b/acrarium/src/main/java/com/faendir/acra/model/view/Queries.java similarity index 100% rename from src/main/java/com/faendir/acra/model/view/Queries.java rename to acrarium/src/main/java/com/faendir/acra/model/view/Queries.java diff --git a/src/main/java/com/faendir/acra/model/view/VApp.java b/acrarium/src/main/java/com/faendir/acra/model/view/VApp.java similarity index 100% rename from src/main/java/com/faendir/acra/model/view/VApp.java rename to acrarium/src/main/java/com/faendir/acra/model/view/VApp.java diff --git a/src/main/java/com/faendir/acra/model/view/VBug.java b/acrarium/src/main/java/com/faendir/acra/model/view/VBug.java similarity index 100% rename from src/main/java/com/faendir/acra/model/view/VBug.java rename to acrarium/src/main/java/com/faendir/acra/model/view/VBug.java diff --git a/src/main/java/com/faendir/acra/model/view/WhereExpressions.java b/acrarium/src/main/java/com/faendir/acra/model/view/WhereExpressions.java similarity index 100% rename from src/main/java/com/faendir/acra/model/view/WhereExpressions.java rename to acrarium/src/main/java/com/faendir/acra/model/view/WhereExpressions.java diff --git a/src/main/java/com/faendir/acra/rest/RestApiInterface.java b/acrarium/src/main/java/com/faendir/acra/rest/RestApiInterface.java similarity index 100% rename from src/main/java/com/faendir/acra/rest/RestApiInterface.java rename to acrarium/src/main/java/com/faendir/acra/rest/RestApiInterface.java diff --git a/src/main/java/com/faendir/acra/rest/RestConfiguration.java b/acrarium/src/main/java/com/faendir/acra/rest/RestConfiguration.java similarity index 100% rename from src/main/java/com/faendir/acra/rest/RestConfiguration.java rename to acrarium/src/main/java/com/faendir/acra/rest/RestConfiguration.java diff --git a/src/main/java/com/faendir/acra/rest/RestReportInterface.java b/acrarium/src/main/java/com/faendir/acra/rest/RestReportInterface.java similarity index 100% rename from src/main/java/com/faendir/acra/rest/RestReportInterface.java rename to acrarium/src/main/java/com/faendir/acra/rest/RestReportInterface.java diff --git a/src/main/java/com/faendir/acra/security/SecurityConfiguration.java b/acrarium/src/main/java/com/faendir/acra/security/SecurityConfiguration.java similarity index 100% rename from src/main/java/com/faendir/acra/security/SecurityConfiguration.java rename to acrarium/src/main/java/com/faendir/acra/security/SecurityConfiguration.java diff --git a/src/main/java/com/faendir/acra/security/SecurityUtils.java b/acrarium/src/main/java/com/faendir/acra/security/SecurityUtils.java similarity index 100% rename from src/main/java/com/faendir/acra/security/SecurityUtils.java rename to acrarium/src/main/java/com/faendir/acra/security/SecurityUtils.java diff --git a/src/main/java/com/faendir/acra/security/VaadinSessionSecurityContextHolderStrategy.java b/acrarium/src/main/java/com/faendir/acra/security/VaadinSessionSecurityContextHolderStrategy.java similarity index 100% rename from src/main/java/com/faendir/acra/security/VaadinSessionSecurityContextHolderStrategy.java rename to acrarium/src/main/java/com/faendir/acra/security/VaadinSessionSecurityContextHolderStrategy.java diff --git a/src/main/java/com/faendir/acra/service/AvatarService.java b/acrarium/src/main/java/com/faendir/acra/service/AvatarService.java similarity index 100% rename from src/main/java/com/faendir/acra/service/AvatarService.java rename to acrarium/src/main/java/com/faendir/acra/service/AvatarService.java diff --git a/src/main/java/com/faendir/acra/service/BugMerger.java b/acrarium/src/main/java/com/faendir/acra/service/BugMerger.java similarity index 100% rename from src/main/java/com/faendir/acra/service/BugMerger.java rename to acrarium/src/main/java/com/faendir/acra/service/BugMerger.java diff --git a/src/main/java/com/faendir/acra/service/ConfigurationUpdateEvent.java b/acrarium/src/main/java/com/faendir/acra/service/ConfigurationUpdateEvent.java similarity index 100% rename from src/main/java/com/faendir/acra/service/ConfigurationUpdateEvent.java rename to acrarium/src/main/java/com/faendir/acra/service/ConfigurationUpdateEvent.java diff --git a/src/main/java/com/faendir/acra/service/DataService.java b/acrarium/src/main/java/com/faendir/acra/service/DataService.java similarity index 100% rename from src/main/java/com/faendir/acra/service/DataService.java rename to acrarium/src/main/java/com/faendir/acra/service/DataService.java diff --git a/src/main/java/com/faendir/acra/service/MailService.java b/acrarium/src/main/java/com/faendir/acra/service/MailService.java similarity index 100% rename from src/main/java/com/faendir/acra/service/MailService.java rename to acrarium/src/main/java/com/faendir/acra/service/MailService.java diff --git a/src/main/java/com/faendir/acra/service/NewReportEvent.java b/acrarium/src/main/java/com/faendir/acra/service/NewReportEvent.java similarity index 100% rename from src/main/java/com/faendir/acra/service/NewReportEvent.java rename to acrarium/src/main/java/com/faendir/acra/service/NewReportEvent.java diff --git a/src/main/java/com/faendir/acra/service/ReportsDeleteEvent.java b/acrarium/src/main/java/com/faendir/acra/service/ReportsDeleteEvent.java similarity index 100% rename from src/main/java/com/faendir/acra/service/ReportsDeleteEvent.java rename to acrarium/src/main/java/com/faendir/acra/service/ReportsDeleteEvent.java diff --git a/src/main/java/com/faendir/acra/service/UserService.java b/acrarium/src/main/java/com/faendir/acra/service/UserService.java similarity index 100% rename from src/main/java/com/faendir/acra/service/UserService.java rename to acrarium/src/main/java/com/faendir/acra/service/UserService.java diff --git a/src/main/java/com/faendir/acra/ui/base/ConfigurationLabel.java b/acrarium/src/main/java/com/faendir/acra/ui/base/ConfigurationLabel.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/ConfigurationLabel.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/ConfigurationLabel.java diff --git a/src/main/java/com/faendir/acra/ui/base/HasAcrariumTitle.java b/acrarium/src/main/java/com/faendir/acra/ui/base/HasAcrariumTitle.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/HasAcrariumTitle.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/HasAcrariumTitle.java diff --git a/src/main/java/com/faendir/acra/ui/base/HasRoute.java b/acrarium/src/main/java/com/faendir/acra/ui/base/HasRoute.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/HasRoute.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/HasRoute.java diff --git a/src/main/java/com/faendir/acra/ui/base/HasSecureParameter.java b/acrarium/src/main/java/com/faendir/acra/ui/base/HasSecureParameter.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/HasSecureParameter.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/HasSecureParameter.java diff --git a/src/main/java/com/faendir/acra/ui/base/MyGrid.java b/acrarium/src/main/java/com/faendir/acra/ui/base/MyGrid.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/MyGrid.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/MyGrid.java diff --git a/src/main/java/com/faendir/acra/ui/base/ParentLayout.java b/acrarium/src/main/java/com/faendir/acra/ui/base/ParentLayout.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/ParentLayout.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/ParentLayout.java diff --git a/src/main/java/com/faendir/acra/ui/base/Path.java b/acrarium/src/main/java/com/faendir/acra/ui/base/Path.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/Path.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/Path.java diff --git a/src/main/java/com/faendir/acra/ui/base/ReportList.java b/acrarium/src/main/java/com/faendir/acra/ui/base/ReportList.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/ReportList.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/ReportList.java diff --git a/src/main/java/com/faendir/acra/ui/base/TabView.java b/acrarium/src/main/java/com/faendir/acra/ui/base/TabView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/TabView.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/TabView.java diff --git a/src/main/java/com/faendir/acra/ui/base/TranslatableText.java b/acrarium/src/main/java/com/faendir/acra/ui/base/TranslatableText.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/TranslatableText.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/TranslatableText.java diff --git a/src/main/java/com/faendir/acra/ui/base/popup/Popup.java b/acrarium/src/main/java/com/faendir/acra/ui/base/popup/Popup.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/popup/Popup.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/popup/Popup.java diff --git a/src/main/java/com/faendir/acra/ui/base/popup/ValidatedField.java b/acrarium/src/main/java/com/faendir/acra/ui/base/popup/ValidatedField.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/popup/ValidatedField.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/popup/ValidatedField.java diff --git a/src/main/java/com/faendir/acra/ui/base/statistics/Chart.java b/acrarium/src/main/java/com/faendir/acra/ui/base/statistics/Chart.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/statistics/Chart.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/statistics/Chart.java diff --git a/src/main/java/com/faendir/acra/ui/base/statistics/PieChart.java b/acrarium/src/main/java/com/faendir/acra/ui/base/statistics/PieChart.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/statistics/PieChart.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/statistics/PieChart.java diff --git a/src/main/java/com/faendir/acra/ui/base/statistics/Property.java b/acrarium/src/main/java/com/faendir/acra/ui/base/statistics/Property.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/statistics/Property.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/statistics/Property.java diff --git a/src/main/java/com/faendir/acra/ui/base/statistics/Statistics.java b/acrarium/src/main/java/com/faendir/acra/ui/base/statistics/Statistics.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/statistics/Statistics.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/statistics/Statistics.java diff --git a/src/main/java/com/faendir/acra/ui/base/statistics/TimeChart.java b/acrarium/src/main/java/com/faendir/acra/ui/base/statistics/TimeChart.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/base/statistics/TimeChart.java rename to acrarium/src/main/java/com/faendir/acra/ui/base/statistics/TimeChart.java diff --git a/src/main/java/com/faendir/acra/ui/component/Card.java b/acrarium/src/main/java/com/faendir/acra/ui/component/Card.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/Card.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/Card.java diff --git a/src/main/java/com/faendir/acra/ui/component/CardDialog.java b/acrarium/src/main/java/com/faendir/acra/ui/component/CardDialog.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/CardDialog.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/CardDialog.java diff --git a/src/main/java/com/faendir/acra/ui/component/CssGrid.java b/acrarium/src/main/java/com/faendir/acra/ui/component/CssGrid.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/CssGrid.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/CssGrid.java diff --git a/src/main/java/com/faendir/acra/ui/component/DownloadButton.java b/acrarium/src/main/java/com/faendir/acra/ui/component/DownloadButton.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/DownloadButton.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/DownloadButton.java diff --git a/src/main/java/com/faendir/acra/ui/component/DropdownMenu.java b/acrarium/src/main/java/com/faendir/acra/ui/component/DropdownMenu.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/DropdownMenu.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/DropdownMenu.java diff --git a/src/main/java/com/faendir/acra/ui/component/FlexLayout.java b/acrarium/src/main/java/com/faendir/acra/ui/component/FlexLayout.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/FlexLayout.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/FlexLayout.java diff --git a/src/main/java/com/faendir/acra/ui/component/HasSize.java b/acrarium/src/main/java/com/faendir/acra/ui/component/HasSize.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/HasSize.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/HasSize.java diff --git a/src/main/java/com/faendir/acra/ui/component/HasStyle.java b/acrarium/src/main/java/com/faendir/acra/ui/component/HasStyle.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/HasStyle.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/HasStyle.java diff --git a/src/main/java/com/faendir/acra/ui/component/HasValidation.java b/acrarium/src/main/java/com/faendir/acra/ui/component/HasValidation.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/HasValidation.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/HasValidation.java diff --git a/src/main/java/com/faendir/acra/ui/component/InstallationView.java b/acrarium/src/main/java/com/faendir/acra/ui/component/InstallationView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/InstallationView.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/InstallationView.java diff --git a/src/main/java/com/faendir/acra/ui/component/Label.java b/acrarium/src/main/java/com/faendir/acra/ui/component/Label.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/Label.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/Label.java diff --git a/src/main/java/com/faendir/acra/ui/component/RangeField.java b/acrarium/src/main/java/com/faendir/acra/ui/component/RangeField.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/RangeField.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/RangeField.java diff --git a/src/main/java/com/faendir/acra/ui/component/RangeInput.java b/acrarium/src/main/java/com/faendir/acra/ui/component/RangeInput.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/RangeInput.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/RangeInput.java diff --git a/src/main/java/com/faendir/acra/ui/component/SubTabs.java b/acrarium/src/main/java/com/faendir/acra/ui/component/SubTabs.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/SubTabs.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/SubTabs.java diff --git a/src/main/java/com/faendir/acra/ui/component/Tab.java b/acrarium/src/main/java/com/faendir/acra/ui/component/Tab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/Tab.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/Tab.java diff --git a/src/main/java/com/faendir/acra/ui/component/Translatable.java b/acrarium/src/main/java/com/faendir/acra/ui/component/Translatable.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/Translatable.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/Translatable.java diff --git a/src/main/java/com/faendir/acra/ui/component/UploadField.java b/acrarium/src/main/java/com/faendir/acra/ui/component/UploadField.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/UploadField.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/UploadField.java diff --git a/src/main/java/com/faendir/acra/ui/component/UserEditor.java b/acrarium/src/main/java/com/faendir/acra/ui/component/UserEditor.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/UserEditor.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/UserEditor.java diff --git a/src/main/java/com/faendir/acra/ui/component/VersionEditorDialog.java b/acrarium/src/main/java/com/faendir/acra/ui/component/VersionEditorDialog.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/component/VersionEditorDialog.java rename to acrarium/src/main/java/com/faendir/acra/ui/component/VersionEditorDialog.java diff --git a/src/main/java/com/faendir/acra/ui/view/AboutView.java b/acrarium/src/main/java/com/faendir/acra/ui/view/AboutView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/AboutView.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/AboutView.java diff --git a/src/main/java/com/faendir/acra/ui/view/MainView.java b/acrarium/src/main/java/com/faendir/acra/ui/view/MainView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/MainView.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/MainView.java diff --git a/src/main/java/com/faendir/acra/ui/view/Overview.java b/acrarium/src/main/java/com/faendir/acra/ui/view/Overview.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/Overview.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/Overview.java diff --git a/src/main/java/com/faendir/acra/ui/view/SettingsView.java b/acrarium/src/main/java/com/faendir/acra/ui/view/SettingsView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/SettingsView.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/SettingsView.java diff --git a/src/main/java/com/faendir/acra/ui/view/app/AppView.java b/acrarium/src/main/java/com/faendir/acra/ui/view/app/AppView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/app/AppView.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/app/AppView.java diff --git a/src/main/java/com/faendir/acra/ui/view/app/tabs/AdminTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/AdminTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/app/tabs/AdminTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/AdminTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/app/tabs/AppTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/AppTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/app/tabs/AppTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/AppTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/app/tabs/BugTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/BugTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/app/tabs/BugTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/BugTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/app/tabs/ReportTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/ReportTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/app/tabs/ReportTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/ReportTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/app/tabs/StatisticsTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/StatisticsTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/app/tabs/StatisticsTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/app/tabs/StatisticsTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/bug/BugView.java b/acrarium/src/main/java/com/faendir/acra/ui/view/bug/BugView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/bug/BugView.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/bug/BugView.java diff --git a/src/main/java/com/faendir/acra/ui/view/bug/tabs/AdminTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/AdminTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/bug/tabs/AdminTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/AdminTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/bug/tabs/BugTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/BugTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/bug/tabs/BugTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/BugTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/bug/tabs/ReportTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/ReportTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/bug/tabs/ReportTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/ReportTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/bug/tabs/StacktraceTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/StacktraceTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/bug/tabs/StacktraceTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/StacktraceTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/bug/tabs/StatisticsTab.java b/acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/StatisticsTab.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/bug/tabs/StatisticsTab.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/bug/tabs/StatisticsTab.java diff --git a/src/main/java/com/faendir/acra/ui/view/report/ReportView.java b/acrarium/src/main/java/com/faendir/acra/ui/view/report/ReportView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/report/ReportView.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/report/ReportView.java diff --git a/src/main/java/com/faendir/acra/ui/view/user/AccountView.java b/acrarium/src/main/java/com/faendir/acra/ui/view/user/AccountView.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/user/AccountView.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/user/AccountView.java diff --git a/src/main/java/com/faendir/acra/ui/view/user/UserManager.java b/acrarium/src/main/java/com/faendir/acra/ui/view/user/UserManager.java similarity index 100% rename from src/main/java/com/faendir/acra/ui/view/user/UserManager.java rename to acrarium/src/main/java/com/faendir/acra/ui/view/user/UserManager.java diff --git a/src/main/java/com/faendir/acra/util/ImportResult.java b/acrarium/src/main/java/com/faendir/acra/util/ImportResult.java similarity index 100% rename from src/main/java/com/faendir/acra/util/ImportResult.java rename to acrarium/src/main/java/com/faendir/acra/util/ImportResult.java diff --git a/src/main/java/com/faendir/acra/util/LocalSettings.java b/acrarium/src/main/java/com/faendir/acra/util/LocalSettings.java similarity index 100% rename from src/main/java/com/faendir/acra/util/LocalSettings.java rename to acrarium/src/main/java/com/faendir/acra/util/LocalSettings.java diff --git a/src/main/java/com/faendir/acra/util/TimeSpanRenderer.java b/acrarium/src/main/java/com/faendir/acra/util/TimeSpanRenderer.java similarity index 100% rename from src/main/java/com/faendir/acra/util/TimeSpanRenderer.java rename to acrarium/src/main/java/com/faendir/acra/util/TimeSpanRenderer.java diff --git a/src/main/java/com/faendir/acra/util/Utils.java b/acrarium/src/main/java/com/faendir/acra/util/Utils.java similarity index 100% rename from src/main/java/com/faendir/acra/util/Utils.java rename to acrarium/src/main/java/com/faendir/acra/util/Utils.java diff --git a/src/main/resources/com/faendir/acra/AppWidgetset.gwt.xml b/acrarium/src/main/resources/com/faendir/acra/AppWidgetset.gwt.xml similarity index 100% rename from src/main/resources/com/faendir/acra/AppWidgetset.gwt.xml rename to acrarium/src/main/resources/com/faendir/acra/AppWidgetset.gwt.xml diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/acrarium/src/main/resources/db/changelog/db.changelog-master.yaml similarity index 100% rename from src/main/resources/db/changelog/db.changelog-master.yaml rename to acrarium/src/main/resources/db/changelog/db.changelog-master.yaml diff --git a/src/main/resources/default.properties b/acrarium/src/main/resources/default.properties similarity index 100% rename from src/main/resources/default.properties rename to acrarium/src/main/resources/default.properties diff --git a/src/main/resources/i18n/com/faendir/acra/messages_de.properties b/acrarium/src/main/resources/i18n/com/faendir/acra/messages_de.properties similarity index 100% rename from src/main/resources/i18n/com/faendir/acra/messages_de.properties rename to acrarium/src/main/resources/i18n/com/faendir/acra/messages_de.properties diff --git a/src/main/resources/i18n/com/faendir/acra/messages_en.properties b/acrarium/src/main/resources/i18n/com/faendir/acra/messages_en.properties similarity index 100% rename from src/main/resources/i18n/com/faendir/acra/messages_en.properties rename to acrarium/src/main/resources/i18n/com/faendir/acra/messages_en.properties diff --git a/src/main/webapp/favicon.ico b/acrarium/src/main/webapp/favicon.ico similarity index 100% rename from src/main/webapp/favicon.ico rename to acrarium/src/main/webapp/favicon.ico diff --git a/src/main/webapp/frontend/logo.png b/acrarium/src/main/webapp/frontend/logo.png similarity index 100% rename from src/main/webapp/frontend/logo.png rename to acrarium/src/main/webapp/frontend/logo.png diff --git a/src/main/webapp/frontend/styles/shared-styles.html b/acrarium/src/main/webapp/frontend/styles/shared-styles.html similarity index 100% rename from src/main/webapp/frontend/styles/shared-styles.html rename to acrarium/src/main/webapp/frontend/styles/shared-styles.html diff --git a/src/test/java/com/faendir/acra/liquibase/LiquibaseTest.java b/acrarium/src/test/java/com/faendir/acra/liquibase/LiquibaseTest.java similarity index 100% rename from src/test/java/com/faendir/acra/liquibase/LiquibaseTest.java rename to acrarium/src/test/java/com/faendir/acra/liquibase/LiquibaseTest.java diff --git a/src/test/java/com/faendir/acra/liquibase/MySQLTest.java b/acrarium/src/test/java/com/faendir/acra/liquibase/MySQLTest.java similarity index 100% rename from src/test/java/com/faendir/acra/liquibase/MySQLTest.java rename to acrarium/src/test/java/com/faendir/acra/liquibase/MySQLTest.java diff --git a/src/test/java/com/faendir/acra/liquibase/OracleTest.java b/acrarium/src/test/java/com/faendir/acra/liquibase/OracleTest.java similarity index 100% rename from src/test/java/com/faendir/acra/liquibase/OracleTest.java rename to acrarium/src/test/java/com/faendir/acra/liquibase/OracleTest.java diff --git a/src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java b/acrarium/src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java similarity index 100% rename from src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java rename to acrarium/src/test/java/com/faendir/acra/rest/RestReportInterfaceTest.java diff --git a/src/test/resources/application-mysql.properties b/acrarium/src/test/resources/application-mysql.properties similarity index 100% rename from src/test/resources/application-mysql.properties rename to acrarium/src/test/resources/application-mysql.properties diff --git a/src/test/resources/application-oracle.properties b/acrarium/src/test/resources/application-oracle.properties similarity index 100% rename from src/test/resources/application-oracle.properties rename to acrarium/src/test/resources/application-oracle.properties diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index ec0794e..0000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'groovy' -} -/* - * (C) Copyright 2018 Lukas Morawietz (https://github.com/F43nd1r) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -repositories { - jcenter() -} - -dependencies { - compile localGroovy() - compile gradleApi() - compile 'com.squareup:javapoet:1.11.1' - compile 'com.google.guava:guava:26.0-jre' -} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/com/faendir/acra/gradle/I18nClassGenerator.groovy b/buildSrc/src/main/groovy/com/faendir/acra/gradle/I18nClassGenerator.groovy deleted file mode 100644 index 7278c76..0000000 --- a/buildSrc/src/main/groovy/com/faendir/acra/gradle/I18nClassGenerator.groovy +++ /dev/null @@ -1,75 +0,0 @@ -/* - * (C) Copyright 2018 Lukas Morawietz (https://github.com/F43nd1r) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.faendir.acra.gradle - -import com.google.common.base.CaseFormat -import com.squareup.javapoet.FieldSpec -import com.squareup.javapoet.JavaFile -import com.squareup.javapoet.TypeSpec -import org.gradle.api.DefaultTask -import org.gradle.api.tasks.CacheableTask -import org.gradle.api.tasks.SkipWhenEmpty -import org.gradle.api.tasks.InputDirectory -import org.gradle.api.tasks.OutputDirectory -import org.gradle.api.tasks.TaskAction -import org.gradle.plugins.ide.idea.IdeaPlugin - -import static javax.lang.model.element.Modifier.* -/** - * @author lukas - * @since 15.08.18 - */ -@CacheableTask -class I18nClassGenerator extends DefaultTask { - @SkipWhenEmpty - @InputDirectory - File inputDirectory - @OutputDirectory - File outputDirectory - String packageName - String className - - I18nClassGenerator() { - project.afterEvaluate { - project.sourceSets.main.java.srcDirs outputs.files - project.plugins.withType(IdeaPlugin.class, { IdeaPlugin idea -> idea.model.module.generatedSourceDirs += outputs.files }) - } - } - - @TaskAction - void exec() { - Set keys = new HashSet<>() - for (File file : project.fileTree(inputDirectory)) { - try { - Properties properties = new Properties() - properties.load(file.newReader()) - keys.addAll(properties.keys() as Collection) - } catch (ignored){ - } - } - TypeSpec.Builder classBuilder = TypeSpec.classBuilder(className).addModifiers(PUBLIC, FINAL) - for (String key : keys) { - classBuilder.addField(FieldSpec.builder(String, CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, key), PUBLIC, STATIC, FINAL).initializer('$S', key).build()) - } - JavaFile.builder(packageName, classBuilder.build()) - .skipJavaLangImports(true) - .indent(" ") - .build() - .writeTo(outputDirectory) - } - -} diff --git a/message-generator-maven-plugin/pom.groovy b/message-generator-maven-plugin/pom.groovy new file mode 100644 index 0000000..4696c0d --- /dev/null +++ b/message-generator-maven-plugin/pom.groovy @@ -0,0 +1,38 @@ +project { + modelVersion '4.0.0' + groupId 'com.faendir' + artifactId 'message-generator-maven-plugin' + version '1.0-SNAPSHOT' + packaging 'maven-plugin' + name 'message-generator-maven-plugin' + + dependencies { + dependency 'org.apache.maven:maven-plugin-api:3.0' + dependency 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.4:provided' + dependency 'com.squareup:javapoet:1.11.1' + dependency 'com.google.guava:guava:26.0-jre' + } + + properties { + 'maven.compiler.source' '1.8' + 'maven.compiler.target' '1.8' + 'project.build.sourceEncoding' 'UTF-8' + 'project.reporting.outputEncoding' 'UTF-8' + } + + build { + plugins { + plugin { + groupId 'org.apache.maven.plugins' + artifactId 'maven-plugin-plugin' + version '3.6.0' + executions { + execution { + id 'mojo-descriptor' + goals 'descriptor' + } + } + } + } + } +} diff --git a/message-generator-maven-plugin/src/main/java/com/faendir/MessageGenerator.java b/message-generator-maven-plugin/src/main/java/com/faendir/MessageGenerator.java new file mode 100644 index 0000000..780a855 --- /dev/null +++ b/message-generator-maven-plugin/src/main/java/com/faendir/MessageGenerator.java @@ -0,0 +1,90 @@ +package com.faendir; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.google.common.base.CaseFormat; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.TypeSpec; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; + +import javax.lang.model.element.Modifier; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Collections; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * Goal which touches a timestamp file. + * + * @goal touch + * @phase process-sources + */ +@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES) +public class MessageGenerator extends AbstractMojo { + @Parameter(property = "inputDirectory", defaultValue = "src/main/resources") + private File inputDirectory; + @Parameter(property = "outputDirectory", defaultValue = "target/generated-sources/java") + private File outputDirectory; + @Parameter(property = "packageName", defaultValue = "com.faendir.i18n") + private String packageName; + @Parameter(property = "className", defaultValue = "Messages") + private String className; + + public void execute() throws MojoExecutionException { + if (!outputDirectory.exists()) { + outputDirectory.mkdirs(); + } + Set keys = new HashSet<>(); + try { + Files.walk(inputDirectory.toPath()) + .peek(file -> System.out.println("Walking " + file)) + .filter(file -> file.toString().endsWith(".properties")) + .peek(file -> System.out.println("Found " + file)) + .forEach(file -> { + try { + Properties properties = new Properties(); + properties.load(new FileReader(file.toFile())); + keys.addAll(Collections.list(properties.keys()).stream().map(Object::toString).collect(Collectors.toList())); + } catch (Exception ignored) { + } + }); + TypeSpec.Builder classBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC, Modifier.FINAL); + for (String key : keys) { + classBuilder.addField(FieldSpec.builder(String.class, CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, key), Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL) + .initializer("$S", key) + .build()); + } + JavaFile.builder(packageName, classBuilder.build()) + .skipJavaLangImports(true) + .indent(" ") + .build() + .writeTo(outputDirectory); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/pom.groovy b/pom.groovy index c54e2f2..271ed13 100644 --- a/pom.groovy +++ b/pom.groovy @@ -15,270 +15,13 @@ */ project { modelVersion '4.0.0' + packaging 'pom' groupId 'com.faendir' - artifactId 'acrarium' - version '0.9.0-SNAPSHOT' - name 'Acrarium' - packaging 'war' + artifactId 'parent' + version '1.0-SNAPSHOT' - properties { - 'maven.compiler.source' '1.8' - 'maven.compiler.target' '1.8' - 'project.build.sourceEncoding' 'UTF-8' - 'project.reporting.outputEncoding' 'UTF-8' - 'drivers.dir' '${project.basedir}/drivers' - 'drivers.downloader.phase' 'pre-integration-test' - 'vaadin.version' '14.0.4' - 'querydsl.version' '4.2.1' - } - - parent { - groupId 'org.springframework.boot' - artifactId 'spring-boot-starter-parent' - version '2.1.8.RELEASE' - } - - pluginRepositories { - pluginRepository { - id 'central' - url 'https://repo1.maven.org/maven2/' - snapshots { - enabled false - } - } - } - - repositories { - repository { - id 'central' - url 'https://repo1.maven.org/maven2/' - snapshots { - enabled false - } - } - repository { - id 'Vaadin Directory' - url 'https://maven.vaadin.com/vaadin-addons' - snapshots { - enabled false - } - } - repository { - id 'Google' - url 'https://maven.google.com' - snapshots { - enabled false - } - } - repository { - id 'jcenter' - url 'https://jcenter.bintray.com' - snapshots { - enabled false - } - } - /*repository { - id 'maven.oracle.com' - url 'https://maven.oracle.com' - layout 'default' - snapshots { - enabled false - } - }*/ - } - - dependencyManagement { - dependencies { - dependency { - groupId 'com.vaadin' - artifactId 'vaadin-bom' - version '${vaadin.version}' - type 'pom' - scope 'import' - } - } - } - - dependencies { - dependency { - groupId 'com.vaadin' - artifactId 'vaadin' - exclusions { - exclusion { - artifactId '*' - groupId 'com.vaadin.webjar' - } - exclusion { - artifactId '*' - groupId 'org.webjars.bowergithub.insites' - } - exclusion { - artifactId '*' - groupId 'org.webjars.bowergithub.polymer' - } - exclusion { - artifactId '*' - groupId 'org.webjars.bowergithub.polymerelements' - } - exclusion { - artifactId '*' - groupId 'org.webjars.bowergithub.vaadin' - } - exclusion { - artifactId '*' - groupId 'org.webjars.bowergithub.webcomponents' - } - } - } - dependency { - groupId 'com.vaadin' - artifactId 'vaadin-spring-boot-starter' - exclusions { - exclusion { - artifactId 'vaadin-core' - groupId 'com.vaadin' - } - } - } - dependency 'org.springframework.boot:spring-boot-starter-data-jpa' - dependency 'mysql:mysql-connector-java' - dependency 'org.springframework.boot:spring-boot-starter-security' - dependency 'org.springframework.boot:spring-boot-starter-mail' - dependency 'org.liquibase:liquibase-core' - dependency 'org.yaml:snakeyaml' - dependency 'com.querydsl:querydsl-jpa:${querydsl.version}' - dependency 'com.querydsl:querydsl-sql:${querydsl.version}' - dependency 'com.querydsl:querydsl-apt:${querydsl.version}:provided' - dependency 'org.jfree:jfreechart:1.5.0' - dependency 'org.apache.xmlgraphics:batik-svggen:1.10' - dependency 'ch.acra:acra-javacore:5.3.0' - dependency 'com.faendir.vaadin:jfreechart-flow:1.1.6' - dependency 'org.codeartisans:org.json:20161124' - dependency 'org.apache.commons:commons-text:1.6' - dependency 'commons-io:commons-io:2.5' - dependency 'org.xbib:time:1.0.0' - dependency 'com.faendir.proguard:retrace:1.3' - dependency 'javax.xml.bind:jaxb-api:2.3.1' - dependency 'com.github.ziplet:ziplet:2.3.0' - dependency 'me.xdrop:fuzzywuzzy:1.2.0' - dependency 'com.talanlabs:avatar-generator:1.1.0' - dependency 'org.ektorp:org.ektorp.spring:1.5.0' - dependency 'com.github.appreciated:apexcharts:2.0.0.beta4' - dependency 'javax.servlet:javax.servlet-api:4.0.1' - dependency { - groupId 'org.springframework.boot' - artifactId 'spring-boot-starter-test' - scope 'test' - } - dependency { - groupId 'org.springframework.security' - artifactId 'spring-security-test' - scope 'test' - } - dependency { - groupId 'com.h2database' - artifactId 'h2' - scope 'test' - } - /*dependency { - groupId 'com.oracle.weblogic' - artifactId 'ojdbc7' - version '12.1.3-0-0' - scope 'test' - }*/ - } - - build { - defaultGoal 'spring-boot:run' - plugins { - plugin { - groupId 'org.springframework.boot' - artifactId 'spring-boot-maven-plugin' - } - plugin { - groupId 'com.vaadin' - artifactId 'vaadin-maven-plugin' - version '${vaadin.version}' - executions { - execution { - goals { - goal 'prepare-frontend' - } - } - } - } - plugin { - groupId 'com.mysema.maven' - artifactId 'apt-maven-plugin' - version '1.1.3' - executions { - execution { - goals 'process' - configuration { - outputDirectory '${project.build.directory}/generated-sources/java' - processor 'com.querydsl.apt.jpa.JPAAnnotationProcessor' - } - } - } - } - plugin { - groupId 'org.codehaus.mojo' - artifactId 'build-helper-maven-plugin' - executions { - execution { - id 'add-source' - phase 'generate-sources' - goals 'add-source' - configuration { - sources { - source '${project.build.directory}/generated-sources/java' - } - } - } - } - dependencies { - dependency 'com.querydsl:querydsl-jpa:${querydsl.version}' - dependency 'com.querydsl:querydsl-apt:${querydsl.version}' - } - } - } - } - - profiles { - profile { - id 'production' - build { - plugins { - plugin { - groupId 'org.springframework.boot' - artifactId 'spring-boot-maven-plugin' - configuration { - jvmArguments '-Dvaadin.productionMode' - } - } - plugin { - groupId 'com.vaadin' - artifactId 'vaadin-maven-plugin' - executions { - execution { - phase 'compile' - goals { - goal 'build-frontend' - } - } - } - } - } - } - properties { - 'vaadin.productionMode' 'true' - } - dependencies { - dependency { - groupId 'com.vaadin' - artifactId 'flow-server-production-mode' - } - } - } + modules { + module 'message-generator-maven-plugin' + module 'acrarium' } } \ No newline at end of file