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. 111
      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_group=io.sc
platform_version=8.1.49
platform_plugin_version=8.1.49
platform_version=8.1.50
platform_plugin_version=8.1.50
platform_core_frontend_version=8.1.410
###########################################################

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

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

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

@ -4,8 +4,10 @@ import java.util.zip.GZIPOutputStream
apply from: "build-version.gradle"
// 判断项目是否是普通前端项目
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 {
classpath "com.gradleup.shadow:shadow-gradle-plugin:${shadow_gradle_plugin_version}"
classpath "org.springframework.boot:org.springframework.boot.gradle.plugin:${spring_boot_version}"
classpath "io.sc:io.sc.platform.gradle:${platform_plugin_version}"
classpath "org.asciidoctor:asciidoctor-gradle-jvm:${asciidoctor_version}"
@ -44,7 +47,7 @@ subprojects {
apply plugin: 'maven-publish'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "org.asciidoctor.jvm.convert"
apply plugin: 'org.asciidoctor.jvm.convert'
configurations.all {
//设置 gradle 拉取依赖包的缓存策略为不进行缓存,可保证每次拉取最新的依赖包
@ -155,9 +158,12 @@ subprojects {
}
clean {
//delete 'dist' //删除前端自动生成的资源目录
//delete 'bin' //删除 eclipse 编译的 bin 目录
delete 'bin' //删除 eclipse 编译的 bin 目录
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){
if(isFrontendProject(file('.'))){
task frontendNpmSync(type:Exec){
if(isFrontendProject(file('.')) && !project.name.contains("io.sc.platform.security.frontend")){
workingDir '.'
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
commandLine 'cmd', '/c', 'pnpm', 'install'
commandLine 'cmd', '/c', 'pnpm', 'sync'
}else{
commandLine 'pnpm', 'install'
commandLine 'pnpm', 'sync'
}
}else{
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
@ -413,22 +419,22 @@ subprojects {
}
}
}
tasks.frontendNpmReInstall.doFirst {
tasks.frontendNpmSync.doFirst {
if(isFrontendProject(file('.'))) {
println '开始执行 pnpm re install ......';
println '开始执行 pnpm sync ......';
}
}
/*-----------------------------------------------------------------
* pnpm sync
* pnpm re install
*----------------------------------------------------------------*/
task frontendNpmSync(type:Exec){
if(isFrontendProject(file('.')) && !project.name.contains("io.sc.platform.security.frontend")){
task frontendNpmReInstall(type:Exec){
if(isFrontendProject(file('.'))){
workingDir '.'
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
commandLine 'cmd', '/c', 'pnpm', 'sync'
commandLine 'cmd', '/c', 'pnpm', 'install'
}else{
commandLine 'pnpm', 'sync'
commandLine 'pnpm', 'install'
}
}else{
if(org.gradle.internal.os.OperatingSystem.current().isWindows()){
@ -438,9 +444,9 @@ subprojects {
}
}
}
tasks.frontendNpmSync.doFirst {
tasks.frontendNpmReInstall.doFirst {
if(isFrontendProject(file('.'))) {
println '开始执行 pnpm sync ......';
println '开始执行 pnpm re install ......';
}
}
@ -508,6 +514,9 @@ subprojects {
}
tasks.frontendGenerateThymeleafTemplate.doLast {
if(isFrontendProject(file('.'))) {
if(!file("dist/public/${project.name}/index.html").exists()){
return;
}
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""");
def output = file("java-src/main/resources/templates/${project.name}.html");
@ -582,6 +591,9 @@ subprojects {
}
tasks.frontendGenerateMenus.doLast {
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());
}
}
@ -598,6 +610,9 @@ subprojects {
}
tasks.frontendGenerateRoutes.doLast {
if(isFrontendProject(file('.'))) {
if(!file("src/routes/routes.json").exists()) {
return;
}
def routes = new groovy.json.JsonSlurper().parseText(file("src/routes/routes.json").text);
for (def route : routes) {
route.module = project.name;
@ -624,10 +639,12 @@ subprojects {
if(isFrontendProject(file('.'))) {
//components---------------------------------------
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);
for (def route : routes) {
components.add(route.component);
}
}
//resources----------------------------------------
List<String> resources = new ArrayList<String>();
@ -647,12 +664,12 @@ subprojects {
}else{
def tree = fileTree('dist') {
include '**/*.*'
exclude '**/webjars/**/*.*'
exclude "public/${project.name}/configure.js"
exclude "public/${project.name}/favicon.svg"
exclude "public/${project.name}/index.html"
exclude "public/${project.name}/login-bg.jpg"
exclude "public/${project.name}/logo.svg"
// exclude '**/webjars/**/*.*'
// exclude "public/${project.name}/configure.js"
// exclude "public/${project.name}/favicon.svg"
// exclude "public/${project.name}/index.html"
// exclude "public/${project.name}/login-bg.jpg"
// exclude "public/${project.name}/logo.svg"
}
tree.each { File file ->
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 之前处理前端资源
*----------------------------------------------------------------*/
@ -717,7 +704,7 @@ subprojects {
// 定义前端构建任务的依赖及执行顺序
frontendNpmInstall.dependsOn(frontendUpdatePackageJson)
frontendNpmSync.dependsOn(frontendNpmInstall)
frontendNpmReInstall.dependsOn(frontendNpmSync);
frontendNpmReInstall.dependsOn(frontendNpmSync)
frontendNpmBuild.dependsOn(frontendNpmReInstall)
frontendNpmProd.dependsOn(frontendNpmReInstall)
@ -736,10 +723,8 @@ subprojects {
frontendGenerateMenus.dependsOn(frontendGenerateI18n);
frontendGenerateRoutes.dependsOn(frontendGenerateMenus);
frontendModule.dependsOn(frontendGenerateRoutes);
gzipFrontend.dependsOn(frontendModule);
frontend.dependsOn(gzipFrontend);
frontend.dependsOn(frontendModule);
//tasks.preBuild.dependsOn(frontend);
processResources.dependsOn(frontend)
processResources {
@ -765,16 +750,6 @@ subprojects {
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_group=io.sc
platform_version=8.1.49
platform_version=8.1.50
platform_plugin_version=8.1.49
platform_core_frontend_version=8.1.358
platform_core_frontend_version=8.1.410
###########################################################
# dependencies version
@ -71,17 +71,18 @@ p6spy_version=3.9.1
pinyin4j_version=2.5.1
poi_version=5.2.5
schemacrawler_version=16.19.11
shadow_gradle_plugin_version=8.3.1
spring_boot_version=2.7.18
spring_cloud_alibaba_version=2021.0.4.0
spring_cloud_context_version=3.1.4
spring_cloud_version=2021.0.8
spring_security_oauth2_authorization_server_version=0.4.5
spring_statemachine_version=3.2.1
truelicense_version=4.0.3
webjars_locator_weblogic_version=0.10
weka_version=3.8.6
zip4j_version=2.11.5
###########################################################
# 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
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
validateDistributionUrl=true
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
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (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.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# 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.
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 limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################

Loading…
Cancel
Save