@@ -38,8 +38,9 @@ public class DmappCreation : Task, ICancelableTask
38
38
public string ProjectFile { get ; set ; }
39
39
public string ProjectType { get ; set ; }
40
40
public string BaseOutputPath { get ; set ; }
41
- public string Configuration { get ; set ; }
42
- public string Version { get ; set ; }
41
+ public string Configuration { get ; set ; } // Release or Debug
42
+ public string PackageId { get ; set ; } // If not specified, defaults to AssemblyName, which defaults to ProjectName
43
+ public string PackageVersion { get ; set ; } // If not specified, defaults to Version, which defaults to VersionPrefix, which defaults to '1.0.0'
43
44
public string MinimumRequiredDmVersion { get ; set ; }
44
45
45
46
#endregion
@@ -98,7 +99,14 @@ public override bool Execute()
98
99
}
99
100
100
101
// Store package in bin\{Debug/Release} folder, similar like nupkg files.
101
- string destinationFilePath = Path . Combine ( BaseOutputPath , Configuration , $ "{ preparedData . Project . ProjectName } .{ Version } .dmapp") ;
102
+ string baseLocation = BaseOutputPath ;
103
+ if ( ! FileSystem . Instance . Path . IsPathRooted ( BaseOutputPath ) )
104
+ {
105
+ // Relative path (starting from project directory
106
+ baseLocation = FileSystem . Instance . Path . GetFullPath ( FileSystem . Instance . Path . Combine ( preparedData . Project . ProjectDirectory , BaseOutputPath ) ) ;
107
+ }
108
+
109
+ string destinationFilePath = Path . Combine ( baseLocation , Configuration , $ "{ PackageId } .{ PackageVersion } .dmapp") ;
102
110
IAppPackage package = appPackageBuilder . Build ( ) ;
103
111
string about = package . CreatePackage ( destinationFilePath ) ;
104
112
Log . LogMessage ( MessageImportance . Low , $ "About created package:{ Environment . NewLine } { about } ") ;
@@ -237,7 +245,7 @@ private bool TryCreateAppPackageBuilder(PackageCreationData preparedData, DataMi
237
245
if ( dataMinerProjectType != DataMinerProjectType . Package )
238
246
{
239
247
// Use default install script
240
- appPackageBuilder = new AppPackage . AppPackageBuilder ( preparedData . Project . ProjectName , Version , preparedData . MinimumRequiredDmVersion ) ;
248
+ appPackageBuilder = new AppPackage . AppPackageBuilder ( preparedData . Project . ProjectName , PackageVersion , preparedData . MinimumRequiredDmVersion ) ;
241
249
return true ;
242
250
}
243
251
@@ -249,7 +257,7 @@ private bool TryCreateAppPackageBuilder(PackageCreationData preparedData, DataMi
249
257
return false ;
250
258
}
251
259
252
- appPackageBuilder = new AppPackage . AppPackageBuilder ( preparedData . Project . ProjectName , Version , preparedData . MinimumRequiredDmVersion , packageResult . Script ) ;
260
+ appPackageBuilder = new AppPackage . AppPackageBuilder ( preparedData . Project . ProjectName , PackageVersion , preparedData . MinimumRequiredDmVersion , packageResult . Script ) ;
253
261
return true ;
254
262
}
255
263
@@ -280,18 +288,18 @@ private PackageCreationData PrepareData()
280
288
loadedProjects [ projectProjectReference . Path ] = referencedProject ;
281
289
}
282
290
283
- string version = GlobalDefaults . MinimumSupportDataMinerVersionForDMApp ;
291
+ string minimumRequiredDmVersion = GlobalDefaults . MinimumSupportDataMinerVersionForDMApp ;
284
292
if ( DataMinerVersion . TryParse ( MinimumRequiredDmVersion , out DataMinerVersion dmVersion ) )
285
293
{
286
- version = dmVersion . ToStrictString ( ) ;
294
+ minimumRequiredDmVersion = dmVersion . ToStrictString ( ) ;
287
295
}
288
296
289
297
return new PackageCreationData
290
298
{
291
299
Project = project ,
292
300
LinkedProjects = referencedProjects ,
293
- Version = Version ,
294
- MinimumRequiredDmVersion = version ,
301
+ Version = PackageVersion ,
302
+ MinimumRequiredDmVersion = minimumRequiredDmVersion ,
295
303
TemporaryDirectory = FileSystem . Instance . Directory . CreateTemporaryDirectory ( ) ,
296
304
} ;
297
305
}
0 commit comments