@@ -95,28 +95,29 @@ target("legacy-script-engine")
95
95
" src/legacy"
96
96
)
97
97
on_load (function (target )
98
- local tag = os .iorun (" git describe --tags --abbrev=0 --always" )
99
- local major , minor , patch , suffix = tag :match (" v(%d+)%.(%d+)%.(%d+)(.*)" )
100
- if not major then
101
- print (" Failed to parse version tag, using 0.0.0" )
102
- major , minor , patch = 0 , 0 , 0
103
- end
104
- local versionStr = major .. " ." .. minor .. " ." .. patch
105
- if suffix then
106
- prerelease = suffix :match (" -(.*)" )
107
- if prerelease then
108
- prerelease = prerelease :gsub (" \n " , " " )
109
- end
98
+ local tag = os .iorun (" git describe --tags --abbrev=0 --always" )
99
+ local major , minor , patch , suffix = tag :match (" v(%d+)%.(%d+)%.(%d+)(.*)" )
100
+ if not major then
101
+ print (" Failed to parse version tag, using 0.0.0" )
102
+ major , minor , patch = 0 , 0 , 0
103
+ end
104
+ local versionStr = major .. " ." .. minor .. " ." .. patch
105
+ if suffix then
106
+ prerelease = suffix :match (" -(.*)" )
107
+ if prerelease then
108
+ prerelease = prerelease :gsub (" \n " , " " )
110
109
end
110
+ end
111
111
112
- if not has_config (" publish" ) then
113
- local hash = os .iorun (" git rev-parse --short HEAD" )
114
- versionStr = versionStr .. " +" .. hash :gsub (" \n " , " " )
115
- end
112
+ if not has_config (" publish" ) then
113
+ local hash = os .iorun (" git rev-parse --short HEAD" )
114
+ versionStr = versionStr .. " +" .. hash :gsub (" \n " , " " )
115
+ end
116
116
117
- target :add (" rules" , " @levibuildscript/modpacker" ,{
118
- modVersion = versionStr
119
- })
117
+ target :add (" rules" , " @levibuildscript/modpacker" ,{
118
+ modName = target :basename (),
119
+ modVersion = versionStr
120
+ })
120
121
end )
121
122
122
123
if is_config (" backend" , " lua" ) then
@@ -129,7 +130,7 @@ target("legacy-script-engine")
129
130
after_build (function (target )
130
131
local baselibPath = path.join (os.projectdir (), " src/baselib/BaseLib.lua" )
131
132
local langPath = path.join (os.projectdir (), " src/lang/" )
132
- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
133
+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
133
134
local baselibOutputPath = path.join (outputPath , " baselib" )
134
135
os .mkdir (baselibOutputPath )
135
136
os .cp (baselibPath , baselibOutputPath )
@@ -146,7 +147,7 @@ target("legacy-script-engine")
146
147
after_build (function (target )
147
148
local baselibPath = path.join (os.projectdir (), " src/baselib/BaseLib.js" )
148
149
local langPath = path.join (os.projectdir (), " src/lang/" )
149
- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
150
+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
150
151
local baselibOutputPath = path.join (outputPath , " baselib" )
151
152
os .mkdir (baselibOutputPath )
152
153
os .cp (baselibPath , baselibOutputPath )
@@ -162,7 +163,7 @@ target("legacy-script-engine")
162
163
after_build (function (target )
163
164
local baselibPath = path.join (os.projectdir (), " src/baselib/BaseLib.py" )
164
165
local langPath = path.join (os.projectdir (), " src/lang/" )
165
- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
166
+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
166
167
local baselibOutputPath = path.join (outputPath , " baselib" )
167
168
os .mkdir (baselibOutputPath )
168
169
os .cp (baselibPath , baselibOutputPath )
@@ -178,7 +179,7 @@ target("legacy-script-engine")
178
179
set_basename (" legacy-script-engine-nodejs" )
179
180
after_build (function (target )
180
181
local langPath = path.join (os.projectdir (), " src/lang/" )
181
- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
182
+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
182
183
os .mkdir (outputPath )
183
184
os .cp (langPath , outputPath )
184
185
end )
0 commit comments