diff --git a/.gitattributes b/.gitattributes index 0b22297..567d4e9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ -*.bat text eol=crlf \ No newline at end of file +*.bat text eol=crlf +gradlew text eol=lf diff --git a/.idea/artifacts/Gradle___biz_redsoft_sample___sample_1_1_1_1_SNAPSHOT_war.xml b/.idea/artifacts/Gradle___biz_redsoft_sample___sample_1_1_1_1_SNAPSHOT_war.xml index 2e2a9af..508d863 100644 --- a/.idea/artifacts/Gradle___biz_redsoft_sample___sample_1_1_1_1_SNAPSHOT_war.xml +++ b/.idea/artifacts/Gradle___biz_redsoft_sample___sample_1_1_1_1_SNAPSHOT_war.xml @@ -2,7 +2,10 @@ $PROJECT_DIR$/build/libs - + + :war + :cleanWar + diff --git a/build.gradle b/build.gradle index 38735fe..13b2038 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,8 @@ apply plugin: 'application' apply plugin: 'war' apply plugin: 'ncore' +apply from: "dependencies.gradle" + targetCompatibility = 1.8 ncore { @@ -42,6 +44,8 @@ dependencies { provided 'javax.servlet:javax.servlet-api:3.1.0' testCompile 'org.junit.jupiter:junit-jupiter:5.8.2' + runtimeClasspath files(ncoreGenerateControlDataJar) + runtimeClasspath files(genJar) } // writing build process to a log file @@ -91,3 +95,16 @@ task buildRelease(type: GradleBuild) { } idea { module.scopes.PROVIDED.plus += [configurations.provided] } + +jar{ + manifest{ + attributes( + 'Main-Class': 'biz.redsoft.ncore.client.MainForm', + 'Class-Path': configurations.runtimeClasspath.collect { it.name }.join(' ') + ) + } +} + +startScripts{ + project.startScripts.defaultJvmOpts = ['-Dlogback.configurationFile=./config/logback.xml'] +} \ No newline at end of file diff --git a/creds.gradle b/creds.gradle new file mode 100644 index 0000000..2d3b997 --- /dev/null +++ b/creds.gradle @@ -0,0 +1,13 @@ +buildscript { + repositories { + maven { + url 'https://nexus.red-soft.ru/repository/ncore-public' + } + mavenLocal() + } + dependencies { + classpath 'nu.studer:gradle-credentials-plugin:1.0.4' + } +} + +apply plugin: 'nu.studer.credentials' diff --git a/db/ncore.7z b/db/ncore.7z deleted file mode 100644 index f9a1fb7..0000000 Binary files a/db/ncore.7z and /dev/null differ diff --git a/db/ncore.zip b/db/ncore.zip new file mode 100644 index 0000000..7da4821 Binary files /dev/null and b/db/ncore.zip differ diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000..8db6fd6 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,13 @@ +repositories { + mavenCentral() + mavenLocal() + maven { + url 'https://nexus.red-soft.ru/repository/public' + if (project.credentials.user != null && project.credentials.password != null) { + credentials { + username project.credentials.user + password project.credentials.password + } + } + } +} diff --git a/ncore-properties-template.xml b/ncore-properties-template.xml index 8b84818..7f1d38c 100644 --- a/ncore-properties-template.xml +++ b/ncore-properties-template.xml @@ -3,4 +3,7 @@ true + + db/ncore.zip + ~/sample-db/ncore-sample.fdb diff --git a/src/dist/bin/starter b/src/dist/bin/starter index ca2dacd..ac830c3 100755 --- a/src/dist/bin/starter +++ b/src/dist/bin/starter @@ -1,5 +1,5 @@ #!/bin/bash cd $(dirname $0)/.. -bin/ncore $1 -config config/ncore-properties.xml $2 $3 $4 $5 +bin/sample $1 -config config/ncore-properties.xml $2 $3 $4 $5 cd $OLDPWD \ No newline at end of file diff --git a/src/dist/bin/starter.bat b/src/dist/bin/starter.bat index 660ffdf..52b1d63 100755 --- a/src/dist/bin/starter.bat +++ b/src/dist/bin/starter.bat @@ -1,5 +1,5 @@ @echo off pushd "%~dp0\.." -call bin\ncore.bat %1 -config config\ncore-properties.xml %2 %3 %4 %5 +call bin\sample.bat %1 -config config\ncore-properties.xml %2 %3 %4 %5 popd \ No newline at end of file diff --git a/src/dist/bin/sync-full b/src/dist/bin/sync-full new file mode 100644 index 0000000..9a59b15 --- /dev/null +++ b/src/dist/bin/sync-full @@ -0,0 +1,15 @@ +#!/bin/bash + +$(dirname $0)/starter patch updates + +if [ $? -ne 0 ] ; then + echo Error patch loading + exit 10 +fi + +$(dirname $0)/starter update -fullSync + +if [ $? -ne 0 ] ; then + echo Error updating database + exit 11 +fi diff --git a/src/dist/bin/sync-full.bat b/src/dist/bin/sync-full.bat new file mode 100644 index 0000000..4fa76e4 --- /dev/null +++ b/src/dist/bin/sync-full.bat @@ -0,0 +1,7 @@ +@echo off + +call "%~dp0\starter.bat" patch updates +if ERRORLEVEL == 1 goto :EOF + +call "%~dp0\starter.bat" update -fullSync +@pause \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 3bd0e54..e46a2be 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -37,18 +37,18 @@ ncore - /client/* - - - ncore - /VAADIN/* + /* + + + biz.redsoft.ncore.dx.init.DxInitializationListener - - client - biz.redsoft.ncore.client.vaadin.VaadinSessionListener diff --git a/src/test/java/biz/redsoft/sample/SampleTests.java b/src/test/java/biz/redsoft/sample/SampleTests.java index 53866da..681fe80 100644 --- a/src/test/java/biz/redsoft/sample/SampleTests.java +++ b/src/test/java/biz/redsoft/sample/SampleTests.java @@ -6,8 +6,8 @@ import java.io.IOException; import java.util.Arrays; import java.util.Properties; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author Victor Bellavin @@ -17,6 +17,6 @@ public class SampleTests { public void testProductName() throws IOException { final Properties props = new Properties(System.getProperties()); Misc.loadProperties(props, Arrays.asList("ncore-properties.xml", "ncore-properties-local.xml")); - Assert.assertEquals(props.getProperty("product.name"), "sample"); + Assertions.assertEquals(props.getProperty("product.name"), "sample"); } } diff --git a/updates/.gitkeep b/updates/.gitkeep new file mode 100644 index 0000000..e69de29