@@ -255,7 +255,7 @@ project.ext {
255
255
// Directory for testing.
256
256
testDir = new File (scriptDirectory, " test_output" )
257
257
// Version of the plugin (update this with CHANGELOG.md on each release).
258
- pluginVersion = " 1.2.177 "
258
+ pluginVersion = " 1.2.178 "
259
259
// Directory that contains the template plugin.
260
260
// Files under this directory are copied into the staging area for the
261
261
// plugin.
@@ -264,14 +264,18 @@ project.ext {
264
264
pluginStagingAreaDir = new File (buildDir, " staging" )
265
265
// Directory where the build plugin is unpacked to.
266
266
pluginExplodedDir = new File (scriptDirectory, " exploded" )
267
+ // Directory where the UPM package is unpacked to.
268
+ pluginUpmDir = new File (scriptDirectory, " upm" )
267
269
// Base filename of the released plugin.
268
270
currentPluginBasename = " external-dependency-manager"
271
+ // Base UPM package name of the released plugin.
272
+ currentPluginUpmPackageName = " com.google.external-dependency-manager"
269
273
// Where the exported plugin file is built before it's copied to the release
270
274
// location.
271
275
pluginExportFile = new File (buildDir, currentPluginBasename + " .unitypackage" )
272
276
// Where the exported UPM plugin file is built.
273
277
pluginUpmExportFile = new File (buildDir,
274
- currentPluginBasename + pluginVersion + " .tgz" )
278
+ currentPluginUpmPackageName + " - " + pluginVersion + " .tgz" )
275
279
// Directory within the plugin staging area that just contains the plugin.
276
280
pluginAssetsDir = new File (" Assets" , " ExternalDependencyManager" )
277
281
// Directories within the staging area to export.
@@ -2069,8 +2073,7 @@ buildPlugin.with {
2069
2073
}
2070
2074
2071
2075
// Guid paths for UPM package.
2072
- File upmPluginPackageDir = new File (" com.google.external-dependency-manager" ,
2073
- " ExternalDependencyManager" )
2076
+ File upmPluginPackageDir = new File (currentPluginUpmPackageName, " ExternalDependencyManager" )
2074
2077
File upmPluginEditorDir = new File (upmPluginPackageDir, " Editor" )
2075
2078
File upmPluginDllDir = new File (upmPluginEditorDir, project. ext. pluginVersion)
2076
2079
@@ -2121,6 +2124,7 @@ task releasePlugin(dependsOn: [buildPlugin, buildUpmPlugin]) {
2121
2124
fileTree(dir : project. ext. pluginExplodedDir),
2122
2125
pluginTemplateFilesMap. values())
2123
2126
doLast {
2127
+ // Delete and regenerate built .unitypackage in the repo.
2124
2128
delete fileTree(
2125
2129
dir : project. ext. pluginReleaseFile. parentFile,
2126
2130
includes : [project. ext. currentPluginBasename + " -*.unitypackage" ])
@@ -2134,6 +2138,7 @@ task releasePlugin(dependsOn: [buildPlugin, buildUpmPlugin]) {
2134
2138
into project. ext. pluginReleaseFileUnversioned. parentFile
2135
2139
rename { src_filename -> project. ext. pluginReleaseFileUnversioned. name }
2136
2140
}
2141
+ // Delete and regenerate the exploded plugin folder in the repo.
2137
2142
delete fileTree(dir : project. ext. pluginExplodedDir)
2138
2143
copy {
2139
2144
from project. ext. pluginStagingAreaDir
@@ -2142,6 +2147,16 @@ task releasePlugin(dependsOn: [buildPlugin, buildUpmPlugin]) {
2142
2147
it. path + " /**/*"
2143
2148
}
2144
2149
}
2150
+ // Delete and regenerate the UPM package in the repo.
2151
+ delete fileTree(dir : project. ext. pluginUpmDir)
2152
+ copy {
2153
+ // Rename the top-level package folder to upm.
2154
+ eachFile {
2155
+ path = path. replaceFirst(/ ^.+?\/ / , " upm/" )
2156
+ }
2157
+ from tarTree(project. ext. pluginUpmExportFile)
2158
+ into project. ext. scriptDirectory
2159
+ }
2145
2160
pluginTemplateFilesMap. each {
2146
2161
sourceFile, targetFile -> copyFile(sourceFile, targetFile)
2147
2162
}
0 commit comments