Skip to content

Commit 59971d3

Browse files
authored
dev (#405)
1 parent b495170 commit 59971d3

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

script.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

scx-build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
start powershell.exe -ExecutionPolicy RemoteSigned -File ".\scx-build.ps1"

script.ps1 renamed to scx-build.ps1

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ param($JAVA_HOME, $MAVEN_HOME)
55

66
#---------------------------------------------- 全局变量 ------------------------------------------------
77
# 当前脚本的版本号
8-
$SCRIPT_VERSION = '6'
8+
$SCRIPT_VERSION = '1'
99
#项目名称
1010
$PROJECT_NAME = '-'
1111
#项目版本
1212
$PROJECT_VERSION = '-'
13-
#构建成品输出位置 默认为当前目录下的 built 文件夹
14-
$OUTPUT_URL = Join-Path (Get-Location) 'built'
13+
#构建成品输出位置 默认为当前目录下的 build 文件夹
14+
$OUTPUT_URL = Join-Path (Get-Location) 'build'
1515

1616
#设置标题
1717
function SetTitle($title)
@@ -23,7 +23,7 @@ function SetOutputUrl()
2323
{
2424
while ($true)
2525
{
26-
$tempOutputUrl = Read-Host '请输入打包文件的输出目录 留空为当前目录下的 built'
26+
$tempOutputUrl = Read-Host '请输入打包文件的输出目录 留空为当前目录下的 build'
2727
if ($tempOutputUrl -ne '')
2828
{
2929
$script:OUTPUT_URL = $tempOutputUrl
@@ -102,7 +102,6 @@ function SetTempEnvironmentVariables()
102102
$PathVariables = $PathVariables + $MAVEN_HOME + ';'
103103
}
104104
$env:Path = $env:Path + $PathVariables
105-
$env:JAVA_TOOL_OPTIONS = '-Dfile.encoding=UTF-8 -Duser.language=zh'
106105
}
107106

108107
function ToZip($from, $to)
@@ -125,7 +124,7 @@ function ShowSuccess()
125124
mvn clean
126125
Write-Host '打包成功' -ForegroundColor Green
127126
Write-Host "后台项目是$OUTPUT_URL\$PROJECT_NAME-$PROJECT_VERSION.jar" -ForegroundColor Green
128-
Write-Host "启动脚本是$OUTPUT_URL\startup-$PROJECT_VERSION.bat" -ForegroundColor Green
127+
Write-Host "启动脚本是$OUTPUT_URL\startup-$PROJECT_NAME-$PROJECT_VERSION.bat" -ForegroundColor Green
129128
pause
130129
explorer $OUTPUT_URL
131130
}
@@ -172,11 +171,10 @@ function CreateWindowsStartupScript()
172171
"@echo off
173172
CHCP 65001
174173
TITLE $PROJECT_NAME-$PROJECT_VERSION
175-
SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 -Duser.language=zh
176174
java -jar $PROJECT_NAME-$PROJECT_VERSION.jar"
177175
# 将内容写入文件
178176
$UTF8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
179-
[System.IO.File]::WriteAllText("$OUTPUT_URL\startup-$PROJECT_VERSION.bat", $ScriptContent, $UTF8NoBomEncoding)
177+
[System.IO.File]::WriteAllText("$OUTPUT_URL\startup-$PROJECT_NAME-$PROJECT_VERSION.bat", $ScriptContent, $UTF8NoBomEncoding)
180178
}
181179

182180
function BuildProject()

0 commit comments

Comments
 (0)