Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Adding AppVeyor Support #10

Merged
merged 2 commits into from
Apr 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ bin/
*/Thumbs.db
*/log.txt
/Assets/
/Build/
*.DS_Store
[Pp]ackages/*/**
artifacts/
22 changes: 22 additions & 0 deletions Build/package.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id></id>
<version>0.0.0</version>
<title></title>
<authors></authors>
<owners></owners>
<projectUrl></projectUrl>
<iconUrl></iconUrl>
<requireLicenseAcceptance></requireLicenseAcceptance>
<description></description>
<summary></summary>
<copyright></copyright>
<licenseUrl></licenseUrl>
<language></language>
<tags></tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="0.0.0" />
</dependencies>
</metadata>
</package>
201 changes: 201 additions & 0 deletions Build/package.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Package" ToolsVersion="4.0">

<!-- IMPORTS -->
<PropertyGroup>
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\tools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
<MSBuildUmbracoTasksPath>$(MSBuildProjectDirectory)\tools\MSBuildUmbracoTasks</MSBuildUmbracoTasksPath>
<MSBuildNugetTasksPath>$(MSBuildProjectDirectory)\tools\MSBuildNugetTasks</MSBuildNugetTasksPath>
<AppVeyorUmbracoPath>$(MSBuildProjectDirectory)\tools\AppVeyorUmbraco</AppVeyorUmbracoPath>
</PropertyGroup>

<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
<Import Project="$(MSBuildUmbracoTasksPath)\MSBuild.Umbraco.Tasks.Targets" />
<Import Project="$(MSBuildNugetTasksPath)\MSBuild.NuGet.Tasks.Targets" />
<Import Project="$(AppVeyorUmbracoPath)\AppVeyorUmbraco.Targets" />

<!-- SHARED PROPERTIES -->
<PropertyGroup>
<ProjectName>Our.Umbraco.DocTypeGridEditor</ProjectName>
<PackageName>Doc Type Grid Editor</PackageName>
<MinUmbracoVersion>7.2.0</MinUmbracoVersion>
<Readme>Doc Type Grid Editor is an advanced grid editor for the new Umbraco v7.2 Grid</Readme>
<AuthorName>Matt Brailsford, Lee Kelleher</AuthorName>
<AuthorUrl>https://github.com/leekelleher/umbraco-doc-type-grid-editor/graphs/contributors</AuthorUrl>
<PackageLicenseName>MIT license</PackageLicenseName>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<ProjectUrl>https://github.com/leekelleher/umbraco-doc-type-grid-editor</ProjectUrl>
</PropertyGroup>

<!-- NUGET ONLY PROPERTIES -->
<PropertyGroup>
<PackageId>Our.Umbraco.DocTypeGridEditor</PackageId>
<NuGetPackageName>Umbraco Doc Type Grid Editor</NuGetPackageName>
<Copyright>Copyright &#169; 2015 Matt Brailsford, Lee Kelleher</Copyright>
<Owners>Matt Brailsford, Lee Kelleher</Owners>
<IconUrl>https://our.umbraco.org/media/wiki/145708/635623742802070736_dtgepng.png</IconUrl>
<Tags>umbraco grid document type editor</Tags>
<Language>en-GB</Language>
<RequireLicenseAcceptance>false</RequireLicenseAcceptance>
</PropertyGroup>

<!-- APPVEYOR PROPERTIES -->
<PropertyGroup>
<FileVersion>$(APPVEYOR_BUILD_VERSION)</FileVersion>
</PropertyGroup>
<Choose>
<When Condition="$(APPVEYOR_BUILD_NUMBER) != '' And $(APPVEYOR_REPO_TAG) != 'true' ">
<PropertyGroup>
<Release>false</Release>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<Release>true</Release>
</PropertyGroup>
</Otherwise>
</Choose>

<Choose>
<When Condition="$(Release) == 'false' And $(UMBRACO_PACKAGE_PRERELEASE_SUFFIX) == 'rtm'">
<PropertyGroup>
<AbortBuild>true</AbortBuild>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AbortBuild>false</AbortBuild>
</PropertyGroup>
</Otherwise>
</Choose>

<!-- PATHS -->
<PropertyGroup>
<BuildConfig>Release</BuildConfig>
<RootDir>$(MSBuildProjectDirectory)\..</RootDir>
<BuildUmbDir>$(MSBuildProjectDirectory)\_umbraco</BuildUmbDir>
<BuildNuGetDir>$(MSBuildProjectDirectory)\_nuget</BuildNuGetDir>
<ArtifactsDir>$(RootDir)\artifacts</ArtifactsDir>
<CoreProjectDir>$(RootDir)\Src\$(ProjectName)</CoreProjectDir>
</PropertyGroup>

<!-- TARGETS -->
<Target Name="GetProductVersion">
<Error Condition="$(AbortBuild) == 'true'" Text="Aborting the build as the UMBRACO_PACKAGE_PRERELEASE_SUFFIX suffix is set 'rtm' but APPVEYOR_REPO_TAG is not 'true'" />
<GetProductVersion BuildVersion="$(APPVEYOR_BUILD_VERSION)" BuildSuffix="$(UMBRACO_PACKAGE_PRERELEASE_SUFFIX)" Release="$(Release)">
<Output TaskParameter="ProductVersion" PropertyName="ProductVersion"/>
</GetProductVersion>
</Target>

<!-- CLEAN -->
<Target Name="Clean" DependsOnTargets="GetProductVersion">
<RemoveDir Directories="$(BuildUmbDir)" Condition="Exists('$(BuildUmbDir)')" />
<RemoveDir Directories="$(BuildNuGetDir)" Condition="Exists('$(BuildNuGetDir)')" />
<RemoveDir Directories="$(ArtifactsDir)" Condition="Exists('$(ArtifactsDir)')" />
<MakeDir Directories="$(BuildUmbDir)" />
<MakeDir Directories="$(BuildNuGetDir)" />
<MakeDir Directories="$(ArtifactsDir)" />
</Target>

<!-- UPDATE PROJECT ASSEMBLEY VERSION -->
<Target Name="UpdateAssemblyInfo" DependsOnTargets="Clean">
<FileUpdate Encoding="ASCII" Files="$(CoreProjectDir)\Properties\AssemblyInfo.cs" Regex="AssemblyVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyVersion(&quot;$(FileVersion)&quot;)]" />
<FileUpdate Encoding="ASCII" Files="$(CoreProjectDir)\Properties\AssemblyInfo.cs" Regex="AssemblyFileVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyFileVersion(&quot;$(FileVersion)&quot;)]" />
<FileUpdate Encoding="ASCII" Files="$(CoreProjectDir)\Properties\AssemblyInfo.cs" Regex="AssemblyInformationalVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyInformationalVersion(&quot;$(ProductVersion)&quot;)]" />
</Target>

<!-- COMPILE -->
<Target Name="Compile" DependsOnTargets="UpdateAssemblyInfo">
<MSBuild Projects="$(CoreProjectDir)\$(ProjectName).csproj" Properties="Configuration=$(BuildConfig)"/>
</Target>

<!-- PREPARE FILES -->
<Target Name="PrepareFiles" DependsOnTargets="Compile">
<ItemGroup>
<BinFiles Include="$(CoreProjectDir)\bin\$(BuildConfig)\$(ProjectName).dll" />
<PdbFiles Include="$(CoreProjectDir)\bin\$(BuildConfig)\$(ProjectName).pdb" />
<SrcFiles Include="$(CoreProjectDir)\**\*.cs" Exclude="$(CoreProjectDir)\obj\**"/>
<PluginFiles Include="$(CoreProjectDir)\Web\UI\**\*.*" />
<PackageFile Include="$(MSBuildProjectDirectory)\package.xml" />
<NuSpecFile Include="$(MSBuildProjectDirectory)\package.nuspec" />
</ItemGroup>
<Copy SourceFiles="@(BinFiles)" DestinationFolder="$(BuildUmbDir)\bin" />
<Copy SourceFiles="@(PackageFile)" DestinationFolder="$(BuildUmbDir)" />
<Copy SourceFiles="@(BinFiles)" DestinationFolder="$(BuildNuGetDir)\lib\net45" />
<Copy SourceFiles="@(PdbFiles)" DestinationFolder="$(BuildNuGetDir)\lib\net45" />
<Copy SourceFiles="@(PluginFiles)" DestinationFiles="@(PluginFiles->'$(BuildUmbDir)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(PluginFiles)" DestinationFiles="@(PluginFiles->'$(BuildNuGetDir)\Content\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(SrcFiles)" DestinationFiles="@(SrcFiles->'$(BuildNuGetDir)\src\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(NuSpecFile)" DestinationFolder="$(BuildNuGetDir)" />
</Target>

<!-- MANIFEST UMBRACO -->
<Target Name="ManifestUmbraco" DependsOnTargets="PrepareFiles">
<ItemGroup>
<ManifestFiles Include="$(BuildUmbDir)\**\*" Exclude="$(BuildUmbDir)\package.xml" />
</ItemGroup>
<ManifestUpdate
ManifestFile="$(BuildUmbDir)\package.xml"
WorkingDirectory="$(BuildUmbDir)"
MinimumRequiredUmbracoVersion="$(MinUmbracoVersion)"
PackageName="$(PackageName)"
PackageVersion="$(ProductVersion)"
AuthorName="$(AuthorName)"
AuthorUrl="$(AuthorUrl)"
Readme="$(Readme)"
PackageLicenseName="$(PackageLicenseName)"
PackageLicenseUrl="$(PackageLicenseUrl)"
PackageUrl="$(ProjectUrl)"
Files="@(ManifestFiles)" />
</Target>

<!-- MANIFEST FOR NUGET PACKAGE -->
<Target Name="ManifestNuGet" DependsOnTargets="PrepareFiles">
<ItemGroup>
<ManifestFiles Include="$(BuildNuGetDir)\**\*" Exclude="$(BuildNuGetDir)\package.nuspec" />
</ItemGroup>
<MSBuild.NuGet.Tasks.ManifestUpdate
ManifestFile="$(BuildNuGetDir)\package.nuspec"
WorkingDirectory="$(BuildNuGetDir)"
Title="$(NuGetPackageName)"
Description="$(Readme)"
Summary="$(Readme)"
Version="$(ProductVersion)"
MinimumRequiredUmbracoVersion ="$(MinUmbracoVersion)"
Authors="$(AuthorName)"
Owners="$(Owners)"
Copyright="$(Copyright)"
LicenseUrl="$(PackageLicenseUrl)"
ProjectUrl="$(ProjectUrl)"
Id="$(PackageId)"
IconUrl="$(IconUrl)"
Language="$(Language)"
RequireLicenseAcceptance="$(RequireLicenseAcceptance)"
Tags="$(Tags)"
Files="@(ManifestFiles)" />
</Target>

<!-- PACKAGE -->
<Target Name="Package" DependsOnTargets="ManifestUmbraco; ManifestNuGet">
<ItemGroup>
<PackageFiles Include="$(BuildUmbDir)\**\*.*" />
</ItemGroup>

<Package ManifestFile="$(BuildUmbDir)\Package.xml"
WorkingDirectory="$(BuildUmbDir)"
OutputDirectory="$(ArtifactsDir)"
Files="@(PackageFiles)" />

<!--<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\.nuget\NuGet.exe"
ManifestFile="$(BuildNuGetDir)\package.nuspec"
BasePath="$(BuildNuGetDir)"
Version="$(ProductVersion)"
OutputDirectory="$(ArtifactsDir)"
Symbols="true" />-->

<RemoveDir Directories="$(BuildUmbDir)" Condition="Exists('$(BuildUmbDir)')" />
<RemoveDir Directories="$(BuildNuGetDir)" Condition="Exists('$(BuildNuGetDir)')" />

</Target>

</Project>
25 changes: 13 additions & 12 deletions Package.xml → Build/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<umbPackage>
<info>
<package>
<name>Doc Type Grid Editor</name>
<version>0.0</version>
<license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
<url>http://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor</url>
<name></name>
<version>0.0.0</version>
<license url=""></license>
<url></url>
<requirements>
<major>7</major>
<minor>2</minor>
<major>0</major>
<minor>0</minor>
<patch>0</patch>
</requirements>
</package>
<author>
<name>Matt Brailsford, Lee Kelleher</name>
<website>http://our.umbraco.org</website>
<name></name>
<website></website>
</author>
<readme><![CDATA[]]></readme>
</info>
Expand All @@ -26,14 +26,15 @@
<DictionaryItems />
<Languages />
<DataTypes />

<Actions>
<Action runat="install" undo="true" alias="AddObjectToJsonArray"
<Action runat="install" undo="true" alias="AddObjectToJsonArray"
keyProperty="alias"
sourceFile="~/App_Plugins/DocTypeGridEditor/Config/grid.editors.config.js"
targetFile="~/Config/grid.editors.config.js" />
</Actions>

</Actions>
<control />

<files />

</umbPackage>
</umbPackage>
49 changes: 49 additions & 0 deletions Build/tools/AppVeyorUmbraco/AppVeyorUmbraco.Targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask
TaskName="GetProductVersion"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
<ParameterGroup>
<BuildVersion ParameterType="System.String" Required="true" />
<BuildSuffix ParameterType="System.String" Required="false" />
<ProductVersion ParameterType="System.String" Output="true" />
<Release ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System"/>
<Using Namespace="System.IO"/>
<Code Type="Fragment" Language="cs">
<![CDATA[
var pos = BuildVersion.LastIndexOf('.');
var len = BuildVersion.Length - pos - 1;

var buildNumberWithZeros = BuildVersion.Substring(pos + 1, len).PadLeft(6, '0');

var baseVersion = BuildVersion.Substring(0, pos);

if ((string.IsNullOrEmpty(BuildSuffix) || BuildSuffix == "rtm") && Release == "true")
{
ProductVersion = baseVersion;
}
else if (string.IsNullOrEmpty(BuildSuffix) && Release == "false")
{
ProductVersion = baseVersion + "-alpha-" + buildNumberWithZeros;
}
else if (!string.IsNullOrEmpty(BuildSuffix) && Release == "true")
{
ProductVersion = baseVersion + "-" + BuildSuffix;
}
else if (!string.IsNullOrEmpty(BuildSuffix) && BuildSuffix != "rtm" && Release == "false")
{
ProductVersion = baseVersion + "-" + BuildSuffix + "-" + buildNumberWithZeros;
}
else
{
ProductVersion = "";
}
//Log.LogError(OutputVer);
]]>
</Code>
</Task>
</UsingTask>
</Project>
12 changes: 12 additions & 0 deletions Build/tools/MSBuildNugetTasks/MSBuild.NuGet.Tasks.Targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<MSBuildNuGetTasksPath Condition="'$(MSBuildNuGetTasksPath)' == ''">$(MSBuildProjectDirectory)\MSBuildTasks</MSBuildNuGetTasksPath>
<MSBuildNuGetTasksLib>$(MSBuildNuGetTasksPath)\MSBuild.NuGet.Tasks.dll</MSBuildNuGetTasksLib>
</PropertyGroup>

<UsingTask AssemblyFile="$(MSBuildNuGetTasksLib)" TaskName="MSBuild.NuGet.Tasks.ManifestUpdate" />
<UsingTask AssemblyFile="$(MSBuildNuGetTasksLib)" TaskName="MSBuild.NuGet.Tasks.Pack" />

</Project>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<MSBuildUmbracoTasksPath Condition="'$(MSBuildUmbracoTasksPath)' == ''">$(MSBuildProjectDirectory)\MSBuildUmbracoTasks</MSBuildUmbracoTasksPath>
<MSBuildUmbracoTasksPath Condition="'$(MSBuildUmbracoTasksPath)' == ''">$(MSBuildProjectDirectory)\MSBuildTasks</MSBuildUmbracoTasksPath>
<MSBuildUmbracoTasksLib>$(MSBuildUmbracoTasksPath)\MSBuild.Umbraco.Tasks.dll</MSBuildUmbracoTasksLib>
</PropertyGroup>

Expand Down
Binary file not shown.
15 changes: 11 additions & 4 deletions Our.Umbraco.DocTypeGridEditor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CEE996
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{D588B45D-9E67-4136-8271-2B8724C8165F}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{D588B45D-9E67-4136-8271-2B8724C8165F}"
ProjectSection(SolutionItems) = preProject
Package.build.cmd = Package.build.cmd
Package.build.xml = Package.build.xml
Package.xml = Package.xml
README.markdown = README.markdown
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Package", "Build Package", "{42CE1449-272B-453B-B162-4558FD38BF41}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
build-appveyor.cmd = build-appveyor.cmd
build.cmd = build.cmd
Build\package.nuspec = Build\package.nuspec
Build\package.proj = Build\package.proj
Build\package.xml = Build\package.xml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
2 changes: 0 additions & 2 deletions Package.build.cmd

This file was deleted.

Loading