10 Commits

8 changed files with 129 additions and 40 deletions

3
.gitignore vendored
View File

@ -7,4 +7,5 @@ gen
.idea/misc.xml .idea/misc.xml
ncore-properties-local.xml ncore-properties-local.xml
*.iml *.iml
/out /out
dependencies.gradle

View File

@ -5,7 +5,7 @@
Для данного проекта можно использовать базу ядра. Для данного проекта можно использовать базу ядра.
Таски запускаются с помощью gradle wrapper. Версия Gradle - 7.5.1. Таски запускаются с помощью gradle wrapper. Версия Gradle - 7.6.4.
Nix Nix
```bash ```bash
@ -20,6 +20,7 @@ gradlew.bat build
### Основные таски ### Основные таски
* ncoreRestoreDatabase (или nRDB) - восстановление базы из бекапа
* ncoreLoadPatches (или patch) - загрузка патчей * ncoreLoadPatches (или patch) - загрузка патчей
* ncoreApplyPatches (или update) - применение патчей * ncoreApplyPatches (или update) - применение патчей
* ncoreUpdateDb (или updateDatabase) - загрузка и применение патчей * ncoreUpdateDb (или updateDatabase) - загрузка и применение патчей
@ -34,6 +35,11 @@ gradlew.bat build
Если нужно выполнить таск, но при этом не выполнять определенные такси из его зависимостей, то можно воспользоваться ключом -x. Если нужно выполнить таск, но при этом не выполнять определенные такси из его зависимостей, то можно воспользоваться ключом -x.
Запуск проекта одной командой:
```bash
./gradlew nRDB build run
```
Компиляция классов: Компиляция классов:
```bash ```bash
./gradlew classes -x generateSources ./gradlew classes -x generateSources
@ -100,7 +106,7 @@ rootProject.name = 'biz.redsoft.myproject'
9. Актуальная версия ядра указывается в файле gradle.properties: 9. Актуальная версия ядра указывается в файле gradle.properties:
``` ```
biz.redsoft.ncore.version=1.8.5.0 biz.redsoft.ncore.version=1.10.339.9
``` ```
Запуск толстого клиента осуществляется в собранном дистрибутиве (distTar или distZip) в каталоге bin командой: Запуск толстого клиента осуществляется в собранном дистрибутиве (distTar или distZip) в каталоге bin командой:
start-client.bat (или ./start-client в линуксе) start-client.bat (или ./start-client в линуксе)

View File

@ -1,26 +1,36 @@
plugins { plugins {
id 'nu.studer.credentials' version('1.0.4') id 'nu.studer.credentials' version('1.0.7')
id 'idea' id 'idea'
id 'eclipse' id 'eclipse'
id 'application' id 'application'
id 'java-library' id 'java-library'
id 'war' id 'war'
id 'gradle-ncore' version('3.0.59') id 'gradle-ncore' version("$pluginVersion")
id 'maven-publish'
} }
//apply from: "dependencies.gradle" java {
withSourcesJar()
sourceCompatibility = project.properties.'java.version' ?: 17
}
targetCompatibility = 1.8 test {
failOnNoDiscoveredTests = false
}
ncore { ncore {
coreVersion = project.properties.'biz.redsoft.ncore.version' coreVersion = project.properties.'biz.redsoft.ncore.version'
sourceEncoding = 'UTF-8' sourceEncoding = 'UTF-8'
} }
group = 'biz.redsoft.sample'
repositories { repositories {
maven { maven {
url 'https://ncore-repo.red-soft.ru/repository/public' def repo = getProperty("biz.redsoft.private.repo")
url repo
if (repo.contains("http:/"))
allowInsecureProtocol = true
if (project.credentials.user != null && project.credentials.password != null) { if (project.credentials.user != null && project.credentials.password != null) {
credentials { credentials {
username project.credentials.user username project.credentials.user
@ -31,17 +41,15 @@ repositories {
} }
dependencies { dependencies {
implementation 'javax.servlet:javax.servlet-api:3.1.0' testCompileOnly 'org.junit.jupiter:junit-jupiter:5.8.2'
testCompileClasspath 'org.junit.jupiter:junit-jupiter:5.8.2'
testImplementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.76' testImplementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.76'
testImplementation 'org.apache.tomcat.embed:tomcat-embed-jasper:9.0.76' testImplementation 'org.apache.tomcat.embed:tomcat-embed-jasper:9.0.76'
runtimeClasspath files(ncoreGenerateControlDataJar) runtimeOnly files(ncoreGenerateControlDataJar)
runtimeClasspath files(genJar) runtimeOnly files(genJar)
implementation("jakarta.servlet:jakarta.servlet-api:5.0.0")
} }
group = 'biz.redsoft.sample'
// writing build process to a log file // writing build process to a log file
// --------------------- BUILD LOG SETTINGS ---------------------- // --------------------- BUILD LOG SETTINGS ----------------------
def tstamp = new Date().format('yyyy-MM-dd_HH-mm-ss') def tstamp = new Date().format('yyyy-MM-dd_HH-mm-ss')
@ -69,7 +77,7 @@ gradle.services.get(LoggingOutputInternal).addStandardErrorListener(new Standard
}) })
// --------------------- BUILD LOG SETTINGS ---------------------- // --------------------- BUILD LOG SETTINGS ----------------------
run.args = ['client', run.args += ['client',
'-config', 'ncore-properties.xml', '-config', 'ncore-properties.xml',
'-config', 'ncore-properties-local.xml'] '-config', 'ncore-properties-local.xml']
@ -88,6 +96,7 @@ task copyDist(type: Copy) {
def versionPropertiesFilePath = sourceSets.main.resources.srcDirs[0].toString() + File.separator + "META-INF/ncore-product/${project.group}/version.properties" def versionPropertiesFilePath = sourceSets.main.resources.srcDirs[0].toString() + File.separator + "META-INF/ncore-product/${project.group}/version.properties"
release { release {
def newVersion = project.getVersion().toString().replace("-SNAPSHOT", "")
commitNewVersion.enabled(true) commitNewVersion.enabled(true)
failOnCommitNeeded = false failOnCommitNeeded = false
failOnPublishNeeded = true failOnPublishNeeded = true
@ -99,22 +108,50 @@ release {
preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: ' preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: '
tagCommitMessage = '[Gradle Release Plugin] - creating tag: ' tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: ' newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
tagTemplate = "${project.name}/v${version}" tagTemplate = "${project.name}/v${newVersion}"
versionPropertyFile = versionPropertiesFilePath versionPropertyFile = versionPropertiesFilePath
versionProperties = [] versionProperties = []
snapshotSuffix = '-SNAPSHOT' snapshotSuffix = '-SNAPSHOT'
buildTasks = ['buildRelease', 'commitNewVersion'] buildTasks = ['ncoreTestDbConnection', 'clean', 'unSnapshotVersion', 'writeVersion', 'commitNewVersion', 'nbackup', 'build', 'copyDist', 'publish', 'dockerFile', 'commitNewVersion']
ignoredSnapshotDependencies = [] ignoredSnapshotDependencies = []
versionPatterns = [ versionPatterns = [
/(\d+)(\.)(\d+)(\.)(\d+)([^\d]*\u0024)/: { Matcher m, Project p -> /(\d+)(\.)(\d+)(\.)(\d+)([^\d]*\u0024)/: { Matcher m, Project p ->
project.getVersion().newVersion().toString() project.getVersion().newVersion().toString()
} }
] ]
pushReleaseVersionBranch = null git.requireBranch.set('master')
pushReleaseVersionBranch = 'master'
} }
task buildRelease(type: GradleBuild) { //Добавить флаг -Pbiz.redsoft.release=true к таске release для того чтобы публиковалось в releases и false если в snapshots.
tasks = ['clean', 'writeVersion', 'nbackup', 'build', 'copyDist', 'publish'] //./gradlew release -Pbiz.redsoft.release=true
publishing {
repositories {
maven {
def isRepoCredetionals = project.hasProperty('biz.redsoft.repo.user') && project.hasProperty('biz.redsoft.repo.password')
def isCredentialsInsideBuildScript = project.credentials.user != null && project.credentials.password != null
println(isRepoCredetionals ? "Using repoCredentials for publish..." :
isCredentialsInsideBuildScript ? "Using buildScript credentials for publish..." : "Credentials are not presented!!!")
if (isRepoCredetionals) {
credentials {
username project.'biz.redsoft.repo.user'
password project.'biz.redsoft.repo.password'
}
} else if (isCredentialsInsideBuildScript) {
credentials {
username project.credentials.user
password project.credentials.password
}
}
def suffix = project.findProperty('biz.redsoft.release') ? 'releases' : 'snapshots'
url "https://ncore-repo.red-soft.ru/repository/${suffix}"
}
}
publications {
mavenJava(MavenPublication) {
from components.java
}
}
} }
@ -136,6 +173,4 @@ distTar {
} }
distZip { distZip {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
} }
ncoreRestoreDB.writeToWebProps = false
ncoreRestoreDB.generateUniqueDBPath = false

View File

@ -1,12 +1,10 @@
repositories { dependencies {
mavenLocal() implementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.68")
maven { updates("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:updates")
url 'https://ncore-repo.red-soft.ru/repository/public' codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.68")
if (project.credentials.user != null && project.credentials.password != null) { implementation("biz.redsoft.ncore:ncore-util-JDK17:1.10.339.68")
credentials { implementation("biz.redsoft.ncore:ncore-cryptoapisec-JDK17:1.10.339.68")
username project.credentials.user implementation("biz.redsoft.ncore:ncore-jna-JDK17:1.10.339.68")
password project.credentials.password codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:gen")
} testImplementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:tests")
}
}
} }

View File

@ -1,4 +1,7 @@
biz.redsoft.ncore.version=1.10.50.0 biz.redsoft.ncore.version=1.10.339.68
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError
org.gradle.daemon=true org.gradle.daemon=false
org.gradle.configureondemand=true org.gradle.configureondemand=true
pluginVersion=4.0.18
biz.redsoft.public.repo=https://ncore-repo.red-soft.ru/repository/public
biz.redsoft.private.repo=https://ncore-repo.red-soft.ru/repository/ncorez

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -1,7 +1,12 @@
pluginManagement{ pluginManagement{
repositories { repositories {
mavenLocal() mavenLocal()
maven { url 'https://ncore-repo.red-soft.ru/repository/public' } maven {
def repo = getProperty("biz.redsoft.public.repo")
url repo
if (repo.contains("http:/"))
allowInsecureProtocol = true
}
} }
} }

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<Objects xsi:schemaLocation="http://www.red-soft.biz/2009/ncore xsd/ncore.xsd" xmlns="http://www.red-soft.biz/2009/ncore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SysPatch CreateDate="2025-05-27T19:56:20.177" Description="Создана подсистема &quot;SAMPLE&quot;" Documentclassid="8001" DocDate="2025-05-27" DocNumber="SAMPLE-0000001" Metaobjectname="SYS_PATCH"
SpNumber="1" SpRevision="1" SpStatus="2" SpSubsystem="SAMPLE" SpTimestamp="2025-05-27T19:56:20.177" SpUser="SYSDBA">
<DetSysLogSysPatch>
<SysLog SlogAction="I" SlogAddress="127.0.0.1/54126" SlogSubsystem="NCORE" SlogTimestamp="2025-05-27T19:56:07.197" SlogTransaction="2808158" SlogUser="SYSDBA"
SobjName="SYS_SUBSYSTEM">
<DetSysLogFieldsSysLog>
<SysLogFields SlfFieldName="CAPTION" SlfFieldString="SAMPLE" SlfIsNew="true"/>
<SysLogFields SlfFieldName="CODE" SlfFieldString="SAMPLE" SlfIsNew="true"/>
<SysLogFields SlfFieldName="UPDATE_ORDER" SlfFieldString="10" SlfIsNew="true"/>
</DetSysLogFieldsSysLog>
</SysLog>
<SysLog SlogAction="I" SlogAddress="127.0.0.1/54126" SlogSubsystem="SAMPLE" SlogTimestamp="2025-05-27T19:56:07.197" SlogTransaction="2808158" SlogUser="SYSDBA"
SobjName="SYS_LOOKUP">
<DetSysLogFieldsSysLog>
<SysLogFields SlfFieldName="SDOM_NAME" SlfFieldString="D_SUBSYSTEM" SlfIsNew="true"/>
<SysLogFields SlfFieldName="SLU_CAPTION" SlfFieldString="SAMPLE" SlfIsNew="true"/>
<SysLogFields SlfFieldName="SLU_GROUP" SlfIsNew="true"/>
<SysLogFields SlfFieldName="SLU_KEY" SlfFieldString="SAMPLE" SlfIsNew="true"/>
<SysLogFields SlfFieldName="SLU_MEMO" SlfIsNew="true"/>
<SysLogFields SlfFieldName="SLU_ORDER" SlfFieldString="10" SlfIsNew="true"/>
<SysLogFields SlfFieldName="SLU_SUBSYSTEM" SlfFieldString="SAMPLE" SlfIsNew="true"/>
</DetSysLogFieldsSysLog>
</SysLog>
<SysLog SlogAction="U" SlogAddress="127.0.0.1/54126" SlogSubsystem="NCORE" SlogTimestamp="2025-05-27T19:56:07.197" SlogTransaction="2808158" SlogUser="SYSDBA"
SobjName="SYS_LOOKUP">
<DetSysLogFieldsSysLog>
<SysLogFields SlfFieldName="SDOM_NAME" SlfFieldString="D_SUBSYSTEM" SlfIsNew="false"/>
<SysLogFields SlfFieldName="SLU_CAPTION" SlfFieldString="Ред Платформа" SlfIsNew="false"/>
<SysLogFields SlfFieldName="SLU_GROUP" SlfIsNew="false"/>
<SysLogFields SlfFieldName="SLU_KEY" SlfFieldString="NCORE" SlfIsNew="false"/>
<SysLogFields SlfFieldName="SLU_MEMO" SlfIsNew="false"/>
<SysLogFields SlfFieldName="SLU_ORDER" SlfFieldString="10" SlfIsNew="false"/>
<SysLogFields SlfFieldName="SLU_ORDER" SlfFieldString="20" SlfIsNew="true"/>
<SysLogFields SlfFieldName="SLU_SUBSYSTEM" SlfFieldString="NCORE" SlfIsNew="false"/>
</DetSysLogFieldsSysLog>
</SysLog>
</DetSysLogSysPatch>
</SysPatch>
</Objects>