Browse Source

后端版本更新到 8.1.50

main
wangshaoping 5 months ago
parent
commit
b2259fcc18
  1. 4
      gradle.properties
  2. 1
      io.sc.platform.gradle/templates/pgp/app/build.gradle
  3. 119
      io.sc.platform.gradle/templates/pgp/setup/build.gradle.txt
  4. 7
      io.sc.platform.gradle/templates/pgp/setup/gradle.properties
  5. 2
      io.sc.platform.gradle/templates/pgp/setup/gradle/wrapper/gradle-wrapper.properties
  6. 7
      io.sc.platform.gradle/templates/pgp/setup/gradlew
  7. 2
      io.sc.platform.gradle/templates/pgp/setup/gradlew.bat

4
gradle.properties

@ -36,8 +36,8 @@ application_version=1.0.0
# platform # platform
########################################################### ###########################################################
platform_group=io.sc platform_group=io.sc
platform_version=8.1.49 platform_version=8.1.50
platform_plugin_version=8.1.49 platform_plugin_version=8.1.50
platform_core_frontend_version=8.1.410 platform_core_frontend_version=8.1.410
########################################################### ###########################################################

1
io.sc.platform.gradle/templates/pgp/app/build.gradle

@ -12,6 +12,7 @@ dependencies {
dependencies { dependencies {
implementation ( implementation (
project(":io.sc.platform.app"), project(":io.sc.platform.app"),
project(":io.sc.platform.license.keygen"),
project(":io.sc.platform.developer"), project(":io.sc.platform.developer"),
project(":io.sc.standard"), project(":io.sc.standard"),

119
io.sc.platform.gradle/templates/pgp/setup/build.gradle.txt

@ -4,8 +4,10 @@ import java.util.zip.GZIPOutputStream
apply from: "build-version.gradle" apply from: "build-version.gradle"
// 判断项目是否是普通前端项目
def isFrontendProject(currentDir){ def isFrontendProject(currentDir){
return file(currentDir.getAbsolutePath() + '/package.json').exists() && !file(currentDir.getAbsolutePath() + '/webpack.env.lib.cjs').exists(); return file(currentDir.getAbsolutePath() + '/package.json').exists()
&& !file(currentDir.getAbsolutePath() + '/webpack.env.lib.cjs').exists();
} }
/*********************************************************************** /***********************************************************************
@ -19,6 +21,7 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath "com.gradleup.shadow:shadow-gradle-plugin:${shadow_gradle_plugin_version}"
classpath "org.springframework.boot:org.springframework.boot.gradle.plugin:${spring_boot_version}" classpath "org.springframework.boot:org.springframework.boot.gradle.plugin:${spring_boot_version}"
classpath "io.sc:io.sc.platform.gradle:${platform_plugin_version}" classpath "io.sc:io.sc.platform.gradle:${platform_plugin_version}"
classpath "org.asciidoctor:asciidoctor-gradle-jvm:${asciidoctor_version}" classpath "org.asciidoctor:asciidoctor-gradle-jvm:${asciidoctor_version}"
@ -44,7 +47,7 @@ subprojects {
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: 'org.springframework.boot' apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management' apply plugin: 'io.spring.dependency-management'
apply plugin: "org.asciidoctor.jvm.convert" apply plugin: 'org.asciidoctor.jvm.convert'
configurations.all { configurations.all {
//设置 gradle 拉取依赖包的缓存策略为不进行缓存,可保证每次拉取最新的依赖包 //设置 gradle 拉取依赖包的缓存策略为不进行缓存,可保证每次拉取最新的依赖包
@ -155,9 +158,12 @@ subprojects {
} }
clean { clean {
//delete 'dist' //删除前端自动生成的资源目录 delete 'bin' //删除 eclipse 编译的 bin 目录
//delete 'bin' //删除 eclipse 编译的 bin 目录
delete 'build' //删除 gradle 构建目录 delete 'build' //删除 gradle 构建目录
delete 'dist' //删除前端打包后的目录
delete 'node_modules' //删除前端 node_modules 目录
delete 'pnpm-lock.yaml' //删除前端 pnpm 文件
delete 'package-lock.json' //删除前端 npm 文件
} }
/*----------------------------------------------------------------- /*-----------------------------------------------------------------
@ -395,15 +401,15 @@ subprojects {
} }
/*----------------------------------------------------------------- /*-----------------------------------------------------------------
* pnpm re install * pnpm sync
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
task frontendNpmReInstall(type:Exec){ task frontendNpmSync(type:Exec){
if(isFrontendProject(file('.'))){ if(isFrontendProject(file('.')) && !project.name.contains("io.sc.platform.security.frontend")){
workingDir '.' workingDir '.'
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){ if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
commandLine 'cmd', '/c', 'pnpm', 'install' commandLine 'cmd', '/c', 'pnpm', 'sync'
}else{ }else{
commandLine 'pnpm', 'install' commandLine 'pnpm', 'sync'
} }
}else{ }else{
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){ if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
@ -413,22 +419,22 @@ subprojects {
} }
} }
} }
tasks.frontendNpmReInstall.doFirst { tasks.frontendNpmSync.doFirst {
if(isFrontendProject(file('.'))) { if(isFrontendProject(file('.'))) {
println '开始执行 pnpm re install ......'; println '开始执行 pnpm sync ......';
} }
} }
/*----------------------------------------------------------------- /*-----------------------------------------------------------------
* pnpm sync * pnpm re install
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
task frontendNpmSync(type:Exec){ task frontendNpmReInstall(type:Exec){
if(isFrontendProject(file('.')) && !project.name.contains("io.sc.platform.security.frontend")){ if(isFrontendProject(file('.'))){
workingDir '.' workingDir '.'
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){ if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
commandLine 'cmd', '/c', 'pnpm', 'sync' commandLine 'cmd', '/c', 'pnpm', 'install'
}else{ }else{
commandLine 'pnpm', 'sync' commandLine 'pnpm', 'install'
} }
}else{ }else{
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){ if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
@ -438,9 +444,9 @@ subprojects {
} }
} }
} }
tasks.frontendNpmSync.doFirst { tasks.frontendNpmReInstall.doFirst {
if(isFrontendProject(file('.'))) { if(isFrontendProject(file('.'))) {
println '开始执行 pnpm sync ......'; println '开始执行 pnpm re install ......';
} }
} }
@ -508,6 +514,9 @@ subprojects {
} }
tasks.frontendGenerateThymeleafTemplate.doLast { tasks.frontendGenerateThymeleafTemplate.doLast {
if(isFrontendProject(file('.'))) { if(isFrontendProject(file('.'))) {
if(!file("dist/public/${project.name}/index.html").exists()){
return;
}
def content = file("dist/public/${project.name}/index.html").text; def content = file("dist/public/${project.name}/index.html").text;
content = content.replace('<script defer src="javascript/main', """<script defer src="${project.name}/javascript/main"""); content = content.replace('<script defer src="javascript/main', """<script defer src="${project.name}/javascript/main""");
def output = file("java-src/main/resources/templates/${project.name}.html"); def output = file("java-src/main/resources/templates/${project.name}.html");
@ -582,6 +591,9 @@ subprojects {
} }
tasks.frontendGenerateMenus.doLast { tasks.frontendGenerateMenus.doLast {
if(isFrontendProject(file('.'))) { if(isFrontendProject(file('.'))) {
if(!file('src/menus/menus.json').exists()) {
return;
}
java.nio.file.Files.copy(file('src/menus/menus.json').toPath(), file('java-src/main/resources/META-INF/platform/plugins/menus.json').toPath()); java.nio.file.Files.copy(file('src/menus/menus.json').toPath(), file('java-src/main/resources/META-INF/platform/plugins/menus.json').toPath());
} }
} }
@ -598,12 +610,15 @@ subprojects {
} }
tasks.frontendGenerateRoutes.doLast { tasks.frontendGenerateRoutes.doLast {
if(isFrontendProject(file('.'))) { if(isFrontendProject(file('.'))) {
if(!file("src/routes/routes.json").exists()) {
return;
}
def routes = new groovy.json.JsonSlurper().parseText(file("src/routes/routes.json").text); def routes = new groovy.json.JsonSlurper().parseText(file("src/routes/routes.json").text);
for(def route : routes){ for (def route : routes) {
route.module=project.name; route.module = project.name;
} }
def json = groovy.json.JsonOutput.toJson(routes); def json = groovy.json.JsonOutput.toJson(routes);
def outputFile =file("java-src/main/resources/META-INF/platform/plugins/frontend-routes.json"); def outputFile = file("java-src/main/resources/META-INF/platform/plugins/frontend-routes.json");
outputFile.withWriter('UTF-8') { writer -> outputFile.withWriter('UTF-8') { writer ->
writer.write(groovy.json.JsonOutput.prettyPrint(json)); writer.write(groovy.json.JsonOutput.prettyPrint(json));
} }
@ -624,10 +639,12 @@ subprojects {
if(isFrontendProject(file('.'))) { if(isFrontendProject(file('.'))) {
//components--------------------------------------- //components---------------------------------------
List<String> components =new ArrayList<String>(); List<String> components =new ArrayList<String>();
if(file("java-src/main/resources/META-INF/platform/plugins/frontend-routes.json").exists()) {
def routes = new groovy.json.JsonSlurper().parseText(file("java-src/main/resources/META-INF/platform/plugins/frontend-routes.json").text); def routes = new groovy.json.JsonSlurper().parseText(file("java-src/main/resources/META-INF/platform/plugins/frontend-routes.json").text);
for(def route : routes){ for (def route : routes) {
components.add(route.component); components.add(route.component);
} }
}
//resources---------------------------------------- //resources----------------------------------------
List<String> resources = new ArrayList<String>(); List<String> resources = new ArrayList<String>();
@ -647,12 +664,12 @@ subprojects {
}else{ }else{
def tree = fileTree('dist') { def tree = fileTree('dist') {
include '**/*.*' include '**/*.*'
exclude '**/webjars/**/*.*' // exclude '**/webjars/**/*.*'
exclude "public/${project.name}/configure.js" // exclude "public/${project.name}/configure.js"
exclude "public/${project.name}/favicon.svg" // exclude "public/${project.name}/favicon.svg"
exclude "public/${project.name}/index.html" // exclude "public/${project.name}/index.html"
exclude "public/${project.name}/login-bg.jpg" // exclude "public/${project.name}/login-bg.jpg"
exclude "public/${project.name}/logo.svg" // exclude "public/${project.name}/logo.svg"
} }
tree.each { File file -> tree.each { File file ->
resources.add(file.absolutePath.substring(dirPath.length())); resources.add(file.absolutePath.substring(dirPath.length()));
@ -674,36 +691,6 @@ subprojects {
} }
} }
task gzipFrontend(){}
tasks.gzipFrontend.doFirst {
if(isFrontendProject(file('.'))) {
println '开始执行 gzip frontend ......'
}
}
tasks.frontendModule.doLast {
if(isFrontendProject(file('.'))) {
// 压缩前端 js 和 css
def tree = fileTree('dist') {
include '**/*.js'
include '**/*.css'
}
tree.each { File file ->
println file.getAbsolutePath()
FileInputStream ins = new FileInputStream(file);
GZIPOutputStream gos = new GZIPOutputStream(new FileOutputStream(file.getAbsolutePath() + ".gz"));
def count;
def data = new byte[1024];
while ((count = ins.read(data, 0, 1024)) != -1) {
gos.write(data, 0, count);
}
gos.finish();
gos.flush();
gos.close();
ins.close();
}
}
}
/*----------------------------------------------------------------- /*-----------------------------------------------------------------
* 打包 jar 之前处理前端资源 * 打包 jar 之前处理前端资源
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
@ -717,7 +704,7 @@ subprojects {
// 定义前端构建任务的依赖及执行顺序 // 定义前端构建任务的依赖及执行顺序
frontendNpmInstall.dependsOn(frontendUpdatePackageJson) frontendNpmInstall.dependsOn(frontendUpdatePackageJson)
frontendNpmSync.dependsOn(frontendNpmInstall) frontendNpmSync.dependsOn(frontendNpmInstall)
frontendNpmReInstall.dependsOn(frontendNpmSync); frontendNpmReInstall.dependsOn(frontendNpmSync)
frontendNpmBuild.dependsOn(frontendNpmReInstall) frontendNpmBuild.dependsOn(frontendNpmReInstall)
frontendNpmProd.dependsOn(frontendNpmReInstall) frontendNpmProd.dependsOn(frontendNpmReInstall)
@ -736,10 +723,8 @@ subprojects {
frontendGenerateMenus.dependsOn(frontendGenerateI18n); frontendGenerateMenus.dependsOn(frontendGenerateI18n);
frontendGenerateRoutes.dependsOn(frontendGenerateMenus); frontendGenerateRoutes.dependsOn(frontendGenerateMenus);
frontendModule.dependsOn(frontendGenerateRoutes); frontendModule.dependsOn(frontendGenerateRoutes);
gzipFrontend.dependsOn(frontendModule); frontend.dependsOn(frontendModule);
frontend.dependsOn(gzipFrontend);
//tasks.preBuild.dependsOn(frontend);
processResources.dependsOn(frontend) processResources.dependsOn(frontend)
processResources { processResources {
@ -765,16 +750,6 @@ subprojects {
excludeDirs += file('dist') excludeDirs += file('dist')
} }
} }
clean {
doFirst{
if(isFrontendProject(file('.'))) {
delete 'dist'
delete 'node_modules'
delete 'pnpm-lock.yaml'
}
}
}
} }
/*********************************************************************** /***********************************************************************

7
io.sc.platform.gradle/templates/pgp/setup/gradle.properties

@ -36,9 +36,9 @@ application_version=1.0.0
# platform # platform
########################################################### ###########################################################
platform_group=io.sc platform_group=io.sc
platform_version=8.1.49 platform_version=8.1.50
platform_plugin_version=8.1.49 platform_plugin_version=8.1.49
platform_core_frontend_version=8.1.358 platform_core_frontend_version=8.1.410
########################################################### ###########################################################
# dependencies version # dependencies version
@ -71,17 +71,18 @@ p6spy_version=3.9.1
pinyin4j_version=2.5.1 pinyin4j_version=2.5.1
poi_version=5.2.5 poi_version=5.2.5
schemacrawler_version=16.19.11 schemacrawler_version=16.19.11
shadow_gradle_plugin_version=8.3.1
spring_boot_version=2.7.18 spring_boot_version=2.7.18
spring_cloud_alibaba_version=2021.0.4.0 spring_cloud_alibaba_version=2021.0.4.0
spring_cloud_context_version=3.1.4 spring_cloud_context_version=3.1.4
spring_cloud_version=2021.0.8 spring_cloud_version=2021.0.8
spring_security_oauth2_authorization_server_version=0.4.5 spring_security_oauth2_authorization_server_version=0.4.5
spring_statemachine_version=3.2.1 spring_statemachine_version=3.2.1
truelicense_version=4.0.3
webjars_locator_weblogic_version=0.10 webjars_locator_weblogic_version=0.10
weka_version=3.8.6 weka_version=3.8.6
zip4j_version=2.11.5 zip4j_version=2.11.5
########################################################### ###########################################################
# asciidoc deploy directory,the path must end with '/' # asciidoc deploy directory,the path must end with '/'
########################################################### ###########################################################

2
io.sc.platform.gradle/templates/pgp/setup/gradle/wrapper/gradle-wrapper.properties

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=http\://nexus.sc.io\:8000/repository/maven-releases/gradle/gradle/8.7/gradle-8.7-bin.zip distributionUrl=http\://nexus.sc.io\:8000/repository/maven-releases/gradle/gradle/8.10.1/gradle-8.10.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

7
io.sc.platform.gradle/templates/pgp/setup/gradlew

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
# #
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum

2
io.sc.platform.gradle/templates/pgp/setup/gradlew.bat

@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################

Loading…
Cancel
Save