Skip to content

Commit

Permalink
#15
Browse files Browse the repository at this point in the history
Included new DnnPackager.Tasks.dll in NuGet Package.
Changed install.ps1 in nuget package to install the new targets file, and remove the old v1 targets file.
Attempted to get tab expansion working for the Install-Module powershell command.
  • Loading branch information
dazinator committed Dec 3, 2015
1 parent 7237b0e commit bca99dd
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 19 deletions.
4 changes: 3 additions & 1 deletion src/DnnPackager.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
</releaseNotes>
</metadata>
<files>
<file src="DnnPackager\tools\**\*.*" target="tools" />
<file src="DnnPackager\tools\**\*.*" target="tools" />
<file src="DnnPackager\DnnPackager.Tasks\bin\$Configuration$\DnnPackager.Tasks.dll" target="tools" />

<file src="DnnPackager\content\**\*.*" target="content" />
<file src="DnnPackager\readme.txt" target="" />
<file src="DnnPackager\bin\$Configuration$\DnnPackager.exe" target="tools" />
Expand Down
2 changes: 1 addition & 1 deletion src/DnnPackager/DnnPackager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<None Include="content\DnnPackageBuilderOverrides.props" />
<None Include="tools\before.solutionname.sln.targets" />
<None Include="tools\DnnPackager.Build.targets" />
<None Include="tools\UserConfig.psm1" />
<None Include="wip\UserConfig.psm1" />
<None Include="tools\init.ps1" />
<None Include="tools\ModuleDeployment.psm1" />
<None Include="tools\Solution.nuspecc" />
Expand Down
26 changes: 15 additions & 11 deletions src/DnnPackager/tools/DnnPackager.Build.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets"/>

<UsingTask TaskName="DnnPackager.Tasks.FindDnnManifestFile" AssemblyFile="DnnPackager.Tasks.dll" />
<UsingTask TaskName="DnnPackager.Tasks.ReadPackageInfoFromManifest" AssemblyFile="DnnPackager.Tasks.dll" />
<UsingTask TaskName="DnnPackager.Tasks.CreateDnnExtensionInstallationZip" AssemblyFile="DnnPackager.Tasks.dll" />
<PropertyGroup>
<DnnPackagerTasksPath Condition="'$(DnnPackagerTasksPath)' == ''">$(MSBuildThisFileDirectory)</DnnPackagerTasksPath>
<DnnPackagerTasksLib>$(DnnPackagerTasksPath)DnnPackager.Tasks.dll</DnnPackagerTasksLib>
</PropertyGroup>

<UsingTask TaskName="DnnPackager.Tasks.FindDnnManifestFile" AssemblyFile="$(DnnPackagerTasksLib)" />
<UsingTask TaskName="DnnPackager.Tasks.ReadPackageInfoFromManifest" AssemblyFile="$(DnnPackagerTasksLib)" />
<UsingTask TaskName="DnnPackager.Tasks.CreateDnnExtensionInstallationZip" AssemblyFile="$(DnnPackagerTasksLib)" />

<!-- Hook into the AfterBuild activity -->
<PropertyGroup>
Expand Down Expand Up @@ -36,7 +41,7 @@
$(MSBuildProjectDirectory)\$(DnnManifestFileName).$(DnnManifestFileExtension)
</DnnManifestFilePath>


<!--<OctoPackPublishPackagesToTeamCity Condition="'$(OctoPackPublishPackagesToTeamCity)' == ''">true</OctoPackPublishPackagesToTeamCity>-->
<!--<OctoPackProjectName Condition="'$(OctoPackProjectName)' == ''">$(MSBuildProjectName)</OctoPackProjectName>-->

Expand All @@ -47,6 +52,8 @@
-->
<Target Name="DnnPackager" Condition="$(RunDnnPackager)">

<Message Text="DnnPackager: Tasks Lib @ $(DnnPackagerTasksLib)"/>

<!--If path of dnn manifest file ($DnnManifestFilePath) not provided, then find it-->
<FindDnnManifestFile ProjectDirectory="$(MSBuildProjectDirectory)" Configuration="$(Configuration)" Condition="'$(DnnManifestFilePath)' == ''">
<Output TaskParameter="ManifestFilePath" ItemName="DnnManifestFilePath"/>
Expand All @@ -72,14 +79,11 @@
<ResourcesZipContentFiles Include="@(Content)" />
<!--The primary output assembly will be included in the install package.-->
<PackageAssemblies Include="$(TargetPath)" />
<!--All debug symbols in the output directory will be included in the install package.
TODO: Look at creating some flag for whether to include symbols or not -->
<!-- Debug symbols in the output directory to be included in the install package when DebugSymbols (common msbuild property) is set to true. -->
<PackageSymbols Include="$(OutDir)\*.pdb" />
<!--Any other files which should be included in the dnn install package. This is a workaround here, which I am creating a dummy entry so that
the msbuild item exists, but only files that actually exist on disk during packaging will be included in the install zip - dummyentry.txt won't exist on disk
and so it won't end up in the install zip which is what I want. -->
<!--Any other files which should be included in the dnn install package. This is a hack here to initialise a collection of files with a dummy item.
Only files that actually exist on disk during packaging will be included in the install zip - dummyentry.txt won't exist on disk so it won't end up in the install zip which is what I want. -->
<PackageFiles Include="DummyEntry.txt" />

</ItemGroup>

<!--Todo: implement this task in c#-->
Expand Down
13 changes: 11 additions & 2 deletions src/DnnPackager/tools/ModuleDeployment.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ function Get-SingleProject($name)
return $project
}

Register-TabExpansion 'Deploy-Module' @{
'buildConfigName' = { "Debug", "Release" }
function Get-Configurations()
{
$solution = Get-Interface $dte.Solution ([EnvDTE80.Solution2])
$solBuild = Get-Interface $solution.SolutionBuild ([EnvDTE.SolutionBuild])
$configs = $solBuild.SolutionConfigurations
$configs = [EnvDTE.SolutionConfigurations]::$solBuild.SolutionConfigurations
return $configs
}

Register-TabExpansion 'Install-Module' @{
'buildConfigName' = { Get-Configurations | Select-Object -Property Name }
}

Export-ModuleMember Install-Module
16 changes: 14 additions & 2 deletions src/DnnPackager/tools/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ $ProjectPath = Split-Path $Project.FullName -parent
$ProjectPropsFile = 'DnnPackageBuilderOverrides.props'
$ProjectPropsPath = $ProjectPath | Join-Path -ChildPath $ProjectPropsFile

$TargetsFile = 'DnnPackager.targets'
$OldTargetsFileV1 = 'DnnPackager.targets'
$TargetsFile = 'DnnPackager.Build.targets'
# $TargetsFolder = 'build\'
# $TargetsPath = $InstallPath | Join-Path -ChildPath $TargetsFolder
# $TargetsPath = $InstallPath | Join-Path -ChildPath $TargetsFile
Expand Down Expand Up @@ -59,7 +60,18 @@ $MSBProject.Xml.AddImport($RelativeProjectPropsPath) | Out-Null

# PACKAGE BUILDER TARGETS
# =======================
# Ensure targets file added, remove existing if found.

# REMOVE OLD V1 TARGETS FILE
$ExistingImports = $MSBProject.Xml.Imports |
Where-Object { $_.Project -like "*\$OldTargetsFileV1" }
if ($ExistingImports) {
$ExistingImports |
ForEach-Object {
$MSBProject.Xml.RemoveChild($_) | Out-Null
}
}

# ADD NEW TARGETS FILE. REMOVE FIRST IF EXISTS.
$ExistingImports = $MSBProject.Xml.Imports |
Where-Object { $_.Project -like "*\$TargetsFile" }
if ($ExistingImports) {
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/nuget.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="..\lib" />
</config>
Expand All @@ -9,7 +10,7 @@
<add key="automatic" value="False" />
</packageRestore>
<packageSources>
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
</packageSources>
<activePackageSource>
<!-- this tells that all of them are active -->
Expand Down

2 comments on commit bca99dd

@dazinator
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity DnnPackager :: Continuos Build 30 is now running

@dazinator
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity DnnPackager :: Continuos Build 1.1.0-unstable.15 outcome was FAILURE
Summary: Tests passed: 4; exit code 1 (new) Build time: 00:00:11

Please sign in to comment.