Compare commits
10 Commits
master
...
ncore-samp
Author | SHA1 | Date | |
---|---|---|---|
4c87ee8325 | |||
079c5a8074 | |||
c6c7da53fa | |||
f6ebda575a | |||
5124bac61b | |||
197efd0354 | |||
53c26d3b8d | |||
86834a4de4 | |||
b67e2c8a75 | |||
2cacafb9c1 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ gen
|
||||
ncore-properties-local.xml
|
||||
*.iml
|
||||
/out
|
||||
dependencies.gradle
|
10
README.md
10
README.md
@ -5,7 +5,7 @@
|
||||
|
||||
Для данного проекта можно использовать базу ядра.
|
||||
|
||||
Таски запускаются с помощью gradle wrapper. Версия Gradle - 7.5.1.
|
||||
Таски запускаются с помощью gradle wrapper. Версия Gradle - 7.6.4.
|
||||
|
||||
Nix
|
||||
```bash
|
||||
@ -20,6 +20,7 @@ gradlew.bat build
|
||||
|
||||
### Основные таски
|
||||
|
||||
* ncoreRestoreDatabase (или nRDB) - восстановление базы из бекапа
|
||||
* ncoreLoadPatches (или patch) - загрузка патчей
|
||||
* ncoreApplyPatches (или update) - применение патчей
|
||||
* ncoreUpdateDb (или updateDatabase) - загрузка и применение патчей
|
||||
@ -34,6 +35,11 @@ gradlew.bat build
|
||||
|
||||
Если нужно выполнить таск, но при этом не выполнять определенные такси из его зависимостей, то можно воспользоваться ключом -x.
|
||||
|
||||
Запуск проекта одной командой:
|
||||
```bash
|
||||
./gradlew nRDB build run
|
||||
```
|
||||
|
||||
Компиляция классов:
|
||||
```bash
|
||||
./gradlew classes -x generateSources
|
||||
@ -100,7 +106,7 @@ rootProject.name = 'biz.redsoft.myproject'
|
||||
|
||||
9. Актуальная версия ядра указывается в файле gradle.properties:
|
||||
```
|
||||
biz.redsoft.ncore.version=1.8.5.0
|
||||
biz.redsoft.ncore.version=1.10.339.9
|
||||
```
|
||||
Запуск толстого клиента осуществляется в собранном дистрибутиве (distTar или distZip) в каталоге bin командой:
|
||||
start-client.bat (или ./start-client в линуксе)
|
||||
|
73
build.gradle
73
build.gradle
@ -1,26 +1,36 @@
|
||||
plugins {
|
||||
id 'nu.studer.credentials' version('1.0.4')
|
||||
id 'nu.studer.credentials' version('1.0.7')
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'application'
|
||||
id 'java-library'
|
||||
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 {
|
||||
coreVersion = project.properties.'biz.redsoft.ncore.version'
|
||||
sourceEncoding = 'UTF-8'
|
||||
}
|
||||
|
||||
group = 'biz.redsoft.sample'
|
||||
|
||||
repositories {
|
||||
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) {
|
||||
credentials {
|
||||
username project.credentials.user
|
||||
@ -31,17 +41,15 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'javax.servlet:javax.servlet-api:3.1.0'
|
||||
testCompileClasspath 'org.junit.jupiter:junit-jupiter:5.8.2'
|
||||
testCompileOnly '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-jasper:9.0.76'
|
||||
runtimeClasspath files(ncoreGenerateControlDataJar)
|
||||
runtimeClasspath files(genJar)
|
||||
runtimeOnly files(ncoreGenerateControlDataJar)
|
||||
runtimeOnly files(genJar)
|
||||
implementation("jakarta.servlet:jakarta.servlet-api:5.0.0")
|
||||
}
|
||||
|
||||
|
||||
group = 'biz.redsoft.sample'
|
||||
|
||||
// writing build process to a log file
|
||||
// --------------------- BUILD LOG SETTINGS ----------------------
|
||||
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 ----------------------
|
||||
|
||||
run.args = ['client',
|
||||
run.args += ['client',
|
||||
'-config', 'ncore-properties.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"
|
||||
|
||||
release {
|
||||
def newVersion = project.getVersion().toString().replace("-SNAPSHOT", "")
|
||||
commitNewVersion.enabled(true)
|
||||
failOnCommitNeeded = false
|
||||
failOnPublishNeeded = true
|
||||
@ -99,22 +108,50 @@ release {
|
||||
preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: '
|
||||
tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
|
||||
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
|
||||
tagTemplate = "${project.name}/v${version}"
|
||||
tagTemplate = "${project.name}/v${newVersion}"
|
||||
versionPropertyFile = versionPropertiesFilePath
|
||||
versionProperties = []
|
||||
snapshotSuffix = '-SNAPSHOT'
|
||||
buildTasks = ['buildRelease', 'commitNewVersion']
|
||||
buildTasks = ['ncoreTestDbConnection', 'clean', 'unSnapshotVersion', 'writeVersion', 'commitNewVersion', 'nbackup', 'build', 'copyDist', 'publish', 'dockerFile', 'commitNewVersion']
|
||||
ignoredSnapshotDependencies = []
|
||||
versionPatterns = [
|
||||
/(\d+)(\.)(\d+)(\.)(\d+)([^\d]*\u0024)/: { Matcher m, Project p ->
|
||||
project.getVersion().newVersion().toString()
|
||||
}
|
||||
]
|
||||
pushReleaseVersionBranch = null
|
||||
git.requireBranch.set('master')
|
||||
pushReleaseVersionBranch = 'master'
|
||||
}
|
||||
|
||||
task buildRelease(type: GradleBuild) {
|
||||
tasks = ['clean', 'writeVersion', 'nbackup', 'build', 'copyDist', 'publish']
|
||||
//Добавить флаг -Pbiz.redsoft.release=true к таске release для того чтобы публиковалось в releases и false если в snapshots.
|
||||
//./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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -137,5 +174,3 @@ distTar {
|
||||
distZip {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
ncoreRestoreDB.writeToWebProps = false
|
||||
ncoreRestoreDB.generateUniqueDBPath = false
|
@ -1,12 +1,10 @@
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven {
|
||||
url 'https://ncore-repo.red-soft.ru/repository/public'
|
||||
if (project.credentials.user != null && project.credentials.password != null) {
|
||||
credentials {
|
||||
username project.credentials.user
|
||||
password project.credentials.password
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.68")
|
||||
updates("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:updates")
|
||||
codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.68")
|
||||
implementation("biz.redsoft.ncore:ncore-util-JDK17:1.10.339.68")
|
||||
implementation("biz.redsoft.ncore:ncore-cryptoapisec-JDK17:1.10.339.68")
|
||||
implementation("biz.redsoft.ncore:ncore-jna-JDK17:1.10.339.68")
|
||||
codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:gen")
|
||||
testImplementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:tests")
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
biz.redsoft.ncore.version=1.10.50.0
|
||||
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError
|
||||
org.gradle.daemon=true
|
||||
biz.redsoft.ncore.version=1.10.339.68
|
||||
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError
|
||||
org.gradle.daemon=false
|
||||
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
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
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
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -1,7 +1,12 @@
|
||||
pluginManagement{
|
||||
repositories {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
41
updates/SAMPLE-0000001.xml
Normal file
41
updates/SAMPLE-0000001.xml
Normal 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="Создана подсистема "SAMPLE"" 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>
|
Reference in New Issue
Block a user