From b2259fcc18ac7ce7bb1c17dbb73a50d75e1ba45c Mon Sep 17 00:00:00 2001 From: wangshaoping Date: Sat, 12 Oct 2024 15:59:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=E7=89=88=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=88=B0=208.1.50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 +- .../templates/pgp/app/build.gradle | 1 + .../templates/pgp/setup/build.gradle.txt | 123 +++++++----------- .../templates/pgp/setup/gradle.properties | 7 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../templates/pgp/setup/gradlew | 7 +- .../templates/pgp/setup/gradlew.bat | 2 + 7 files changed, 64 insertions(+), 82 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0b916d87..9d04acb2 100644 --- a/gradle.properties +++ b/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 ########################################################### diff --git a/io.sc.platform.gradle/templates/pgp/app/build.gradle b/io.sc.platform.gradle/templates/pgp/app/build.gradle index 7b1349a4..b5802a49 100644 --- a/io.sc.platform.gradle/templates/pgp/app/build.gradle +++ b/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"), diff --git a/io.sc.platform.gradle/templates/pgp/setup/build.gradle.txt b/io.sc.platform.gradle/templates/pgp/setup/build.gradle.txt index 085ac72e..f3947a0b 100644 --- a/io.sc.platform.gradle/templates/pgp/setup/build.gradle.txt +++ b/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('