@@ -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
@@ -2142,6 +2145,15 @@ task releasePlugin(dependsOn: [buildPlugin, buildUpmPlugin]) {
2142
2145
it. path + " /**/*"
2143
2146
}
2144
2147
}
2148
+ delete fileTree(dir : project. ext. pluginUpmDir)
2149
+ copy {
2150
+ // Rename the top-level package folder to upm.
2151
+ eachFile {
2152
+ path = path. replaceFirst(/ ^.+?\/ / , " upm/" )
2153
+ }
2154
+ from tarTree(project. ext. pluginUpmExportFile)
2155
+ into project. ext. scriptDirectory
2156
+ }
2145
2157
pluginTemplateFilesMap. each {
2146
2158
sourceFile, targetFile -> copyFile(sourceFile, targetFile)
2147
2159
}
0 commit comments