Skip to content

Commit

Permalink
Merge pull request #1579 from cwensley/curtis/template-updates
Browse files Browse the repository at this point in the history
Update templates
  • Loading branch information
cwensley authored Feb 15, 2020
2 parents c464dcd + 261d418 commit c1b2bc2
Show file tree
Hide file tree
Showing 42 changed files with 258 additions and 255 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ artifacts:
- path: artifacts/test
name: test
type: zip
- path: artifacts/addin/Release/VisualStudio/Eto.Addin.VisualStudio.vsix
- path: artifacts/addin/Release/VisualStudio/Eto.Addin.VisualStudio*.vsix
name: vsix
branches:
only:
Expand Down
54 changes: 35 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,44 @@ jobs:
- task: CopyFiles@2
displayName: Copy nupkg
inputs:
sourceFolder: artifacts/nuget/$(build.configuration)/
contents: |
artifacts/nuget/$(build.configuration)/Eto.Platform.XamMac*.nupkg
artifacts/nuget/$(build.configuration)/Eto.Platform.Gtk2*.nupkg
targetFolder: $(Build.ArtifactStagingDirectory)
Eto.Platform.XamMac*.nupkg
Eto.Platform.Gtk2*.nupkg
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/

- task: PublishBuildArtifacts@1
displayName: Publish nupkg
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/artifacts/nuget/$(build.configuration)
pathtoPublish: $(Build.ArtifactStagingDirectory)/nuget/
artifactName: nuget
publishLocation: container

- task: msbuild@1
displayName: Build MonoDevelop Addin
inputs:
solution: build/Build.proj
msbuildArguments: /t:BuildAddins
msbuildArguments: /t:BuildAddins /v:minimal /bl:$(Build.ArtifactStagingDirectory)/msbuild-binlog/MSBuild.BuildAddins.MacOS.binlog

- task: CopyFiles@2
displayName: Copy MonoDevelop Addin
inputs:
contents: artifacts/addin/$(build.configuration)/net472/Eto.Addin.MonoDevelop*.mpack
targetFolder: $(Build.ArtifactStagingDirectory)
sourceFolder: artifacts/addin/$(build.configuration)/net472/
contents: Eto.Addin.MonoDevelop*.mpack
targetFolder: $(Build.ArtifactStagingDirectory)/addin/

- task: PublishBuildArtifacts@1
displayName: Publish MonoDevelop Addin
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/artifacts/addin/$(build.configuration)/net472
pathtoPublish: $(Build.ArtifactStagingDirectory)/addin/
artifactName: addins
publishLocation: container

- task: PublishBuildArtifacts@1
condition: failed()
displayName: Publish MSBuild logs
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/msbuild-binlog
pathtoPublish: $(Build.ArtifactStagingDirectory)/msbuild-binlog/
artifactName: msbuild-binlog
publishLocation: container

Expand All @@ -101,33 +103,47 @@ jobs:
solution: build/Build.proj
msbuildArguments: $(build.arguments) /p:HaveWindowsDesktopSdk=true /v:minimal /bl:$(Build.ArtifactStagingDirectory)/msbuild-binlog/MSBuild.BuildPackage.Windows.binlog

- task: msbuild@1
displayName: Build Visual Studio Addin
inputs:
solution: build/Build.proj
msbuildArguments: /t:BuildAddins /p:HaveWindowsDesktopSdk=true /v:minimal /bl:$(Build.ArtifactStagingDirectory)/msbuild-binlog/MSBuild.BuildAddins.Windows.binlog

- task: PublishBuildArtifacts@1
displayName: Publish nupkg
inputs:
pathtoPublish: artifacts/nuget/$(build.configuration)
pathtoPublish: artifacts/nuget/$(build.configuration)/
artifactName: nuget
publishLocation: container
- task: PublishBuildArtifacts@1
displayName: Publish tests
inputs:
pathtoPublish: artifacts/test/$(build.configuration)
pathtoPublish: artifacts/test/$(build.configuration)/
artifactName: test
publishLocation: container
- task: PublishBuildArtifacts@1
displayName: Publish samples
inputs:
pathtoPublish: artifacts/samples/$(build.configuration)
pathtoPublish: artifacts/samples/$(build.configuration)/
artifactName: samples
publishLocation: container

- task: msbuild@1
displayName: Build Visual Studio Addin
inputs:
solution: build/Build.proj
msbuildArguments: /t:BuildAddins /p:HaveWindowsDesktopSdk=true /v:minimal /bl:$(Build.ArtifactStagingDirectory)/msbuild-binlog/MSBuild.BuildAddins.Windows.binlog
- task: CopyFiles@2
displayName: Copy Visual Studio Addin
inputs:
sourceFolder: artifacts/addin/$(build.configuration)/VisualStudio/
contents: Eto.Addin.VisualStudio*.vsix
targetFolder: $(Build.ArtifactStagingDirectory)/addin/
- task: PublishBuildArtifacts@1
displayName: Publish Visual Studio Addin
inputs:
pathtoPublish: artifacts/addin/$(build.configuration)/VisualStudio/Eto.Addin.VisualStudio.vsix
pathtoPublish: $(Build.ArtifactStagingDirectory)/addin/
artifactName: addins
publishLocation: container

- task: PublishBuildArtifacts@1
condition: failed()
displayName: Publish MSBuild logs
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/msbuild-binlog/
artifactName: msbuild-binlog
publishLocation: container
12 changes: 6 additions & 6 deletions build/Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,21 @@
<OtherOptions Include="xm" Value="-xm" />
<OtherOptions Include="wf_xm" Value="-wf -xm" />

<Separate Include="separate" Value="-s" />
<Separate Include="combined" Value="" />
<Combined Include="separate" Value="" />
<Combined Include="combined" Value="-c" />

<Framework Include="full" />
<Framework Include="core" />
<Framework Include="both" />

<CombinedProject1 Include="*" LanguageId="%(Language.Identity)" Language="%(Language.Value)" />
<CombinedProject2 Include="@(CombinedProject1)" ModeId="%(Mode.Identity)" Mode="%(Mode.Identity)" />
<CombinedProject3 Include="@(CombinedProject2)" SeparateId="%(Separate.Identity)" Separate="%(Separate.Value)" />
<CombinedProject4 Include="@(CombinedProject3)" OtherId="%(OtherOptions.Identity)" Other="%(OtherOptions.Value)" />
<CombinedProject Include="@(CombinedProject4)" FrameworkId="%(Framework.Identity)" Framework="%(Framework.Identity)" />
<CombinedProject3 Include="@(CombinedProject2)" CombinedId="%(Combined.Identity)" Combined="%(Combined.Value)" />
<CombinedProject4 Include="@(CombinedProject3)" FrameworkId="%(Framework.Identity)" Framework="%(Framework.Identity)" />
<CombinedProject Include="@(CombinedProject4)" OtherId="%(OtherOptions.Identity)" Other="%(OtherOptions.Value)" />
</ItemGroup>

<Exec Command="dotnet new etoapp -m %(CombinedProject.Mode) -sln -lang %(Language) %(Other) %(Separate) -f %(Framework) -o $(ArtifactsDir)templates\App.%(LanguageId)-%(SeparateId)-%(OtherId)-%(ModeId)-%(FrameworkId)" />
<Exec Command="export DOTNET_NEW_LOCAL_SEARCH_FILE_ONLY=TRUE &amp;&amp; dotnet new etoapp -m %(CombinedProject.Mode) -sln -lang %(Language) %(Other) %(Combined) -f %(Framework) -o $(ArtifactsDir)templates\App.%(LanguageId)-%(CombinedId)-%(OtherId)-%(ModeId)-%(FrameworkId)" />

<!-- generate file templates -->
<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/Addins/Eto.Addin.MonoDevelop.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto.Serialization.Xaml", ".
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto.Serialization.Json", "..\Eto.Serialization.Json\Eto.Serialization.Json.csproj", "{FCEFD5C0-8705-11E4-B4A9-0800200C9A66}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4E4F6B1-48B2-4D57-8CEB-39796557ECB5}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{B4E4F6B1-48B2-4D57-8CEB-39796557ECB5}"
ProjectSection(SolutionItems) = preProject
..\..\addin-project.xml = ..\..\addin-project.xml
..\..\NuGet.Config = ..\..\NuGet.Config
..\..\Directory.Build.props = ..\..\Directory.Build.props
..\..\Directory.Build.targets = ..\..\Directory.Build.targets
..\..\build\Build.proj = ..\..\build\Build.proj
..\..\build\Common.Build.props = ..\..\build\Common.Build.props
..\..\build\Common.Build.targets = ..\..\build\Common.Build.targets
..\..\build\Common.props = ..\..\build\Common.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto", "..\Eto\Eto.csproj", "{04348E2F-003F-4CFF-B0CB-5E8B073FCA91}"
Expand Down
12 changes: 10 additions & 2 deletions src/Addins/Eto.Addin.MonoDevelop/Eto.Addin.MonoDevelop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
</ItemGroup>
<ItemGroup>
<AddinFile Include="Templates\Files\**\*" />
<AddinFile Include="$(ArtifactsDir)\nuget\$(Configuration)\Eto.Forms.Templates.2.5.0-dev.nupkg">
<Link>Packages\Eto.Forms.Templates.2.5.0-dev.nupkg</Link>
<AddinFile Include="$(ArtifactsDir)\nuget\$(Configuration)\Eto.Forms.Templates.$(InformationalVersion).nupkg">
<Link>Packages\Eto.Forms.Templates.$(InformationalVersion).nupkg</Link>
</AddinFile>
</ItemGroup>
<ItemGroup>
Expand All @@ -51,4 +51,12 @@
<AddinReference Update="MonoDevelop.Ide" Version="$(MonoDevelopVersion)" />
</ItemGroup>
</Target>

<Target Name="RenameMpack" AfterTargets="PackageAddin">
<PropertyGroup>
<MPackName>$(OutputPath)Eto.Addin.MonoDevelop-$(InformationalVersion).mpack</MPackName>
</PropertyGroup>
<Delete Files="$(MPackName)" />
<Move SourceFiles="$(PackageFile)" DestinationFiles="$(MPackName)" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
imageId="eto-project"
wizard="Eto.Addin.MonoDevelop.ProjectWizard"
category="multiplat/app/eto"
supportedParameters="AppName,Separated,Xeto,Preview,Jeto,XamMac,NoDash,Framework"
supportedParameters="AppName,Combined,Xeto,Preview,Jeto,XamMac,NoDash,Framework"
/>
<Template
id="Eto.App.FSharp"
path="Packages/Eto.Forms.Templates.2.5.0-dev.nupkg"
imageId="eto-project"
wizard="Eto.Addin.MonoDevelop.ProjectWizard"
category="multiplat/app/eto"
supportedParameters="AppName,Separated,Xeto,Preview,Jeto,XamMac,NoDash,Framework"
supportedParameters="AppName,Combined,Xeto,Preview,Jeto,XamMac,NoDash,Framework"
/>
</Extension>

Expand Down
37 changes: 23 additions & 14 deletions src/Addins/Eto.Addin.Shared/ProjectWizardPageModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ProjectWizardPageModel(IParameterSource source, XElement optionsElement)
UsePCL = SupportsPCL;
UseNET = !SupportsPCL;
UseSAL = false;
Separate = false;
Combined = false;
Mode = "code";
IncludeSolution = false;
if (SupportsBase)
Expand All @@ -40,6 +40,8 @@ public bool IsValid
if (string.IsNullOrWhiteSpace(AppName) || AppNameInvalid)
return false;
}
if (SupportsFramework && !SelectedFrameworks.Any())
return false;
return true;
}
}
Expand Down Expand Up @@ -94,7 +96,7 @@ public string AppName

public bool SupportsProjectType => SupportsPCL || SupportsSAL || SupportsNetStandard;

public bool SupportsSeparated => Source.IsSupportedParameter("Separated");
public bool SupportsCombined => Source.IsSupportedParameter("Combined");

public bool SupportsXamMac => Source.IsSupportedParameter("XamMac");

Expand All @@ -110,12 +112,12 @@ public string AppName

public bool NoDash => Source.IsSupportedParameter("NoDash");

public bool Separate
public bool Combined
{
get { return Source.GetParameter("Separate").ToBool(); }
get { return Source.GetParameter("Combined").ToBool(); }
set
{
Source.SetParameter("Separate", value.ToString());
Source.SetParameter("Combined", value.ToString());
OnPropertyChanged();
OnPropertyChanged(nameof(Information));
}
Expand Down Expand Up @@ -215,21 +217,22 @@ public override string Title
set { base.Title = value; }
}

public bool RequiresInput => SupportsSeparated || SupportsProjectType || SupportsPanelType;
public bool RequiresInput => SupportsCombined || SupportsProjectType || SupportsPanelType;

public class FrameworkInfo
{
public string Text { get; set; }
public string Value { get; set; }
public string Description { get; set; }
public bool CanUseCombined { get; set; }
}

public FrameworkInfo[] SupportedFrameworks => frameworkInformation;

static readonly FrameworkInfo[] frameworkInformation =
{
new FrameworkInfo { Text = "Full .NET Framework", Value = "full"},
new FrameworkInfo { Text = ".NET Core", Value = "core" }
new FrameworkInfo { Text = "Full .NET Framework", Value = "full", CanUseCombined = true },
new FrameworkInfo { Text = ".NET Core", Value = "core", CanUseCombined = false }
};

List<FrameworkInfo> _selectedFrameworks;
Expand All @@ -243,11 +246,17 @@ public IEnumerable<object> SelectedFrameworks

string parameterValue = _selectedFrameworks.Count == 1 ? _selectedFrameworks[0].Value : "both";
Source.SetParameter("Framework", parameterValue);

if (!AllowCombined)
Combined = false;
OnPropertyChanged();
OnPropertyChanged(nameof(Information));
OnPropertyChanged(nameof(AllowCombined));
}
}

public bool AllowCombined => _selectedFrameworks?.All(r => r.CanUseCombined) == true;


struct TypeInfo
{
Expand All @@ -266,14 +275,14 @@ struct TypeInfo
struct CombinedInfo
{
public string Text;
public bool Separate;
public bool Combined;
public bool? IncludeXamMac;
}

static CombinedInfo[] combinedInformation = {
new CombinedInfo { Separate = false, IncludeXamMac = true, Text = "A single combined project that can build for Windows, Linux and Mac, and a separate Xamarin.Mac project to bundle mono with VS for Mac." },
new CombinedInfo { Separate = false, IncludeXamMac = false, Text = "A single combined project that can build for Windows, Linux, and Mac." },
new CombinedInfo { Separate = true, Text = "A separate project for each platform." },
new CombinedInfo { Combined = true, IncludeXamMac = true, Text = "A single combined project that can build for Windows, Linux and Mac, and a separate Xamarin.Mac project to bundle mono with VS for Mac." },
new CombinedInfo { Combined = true, IncludeXamMac = false, Text = "A single combined project that can build for Windows, Linux, and Mac." },
new CombinedInfo { Combined = false, Text = "A separate project for each platform." },
};

struct FormatInfo
Expand Down Expand Up @@ -307,10 +316,10 @@ public string Information
{
var text = new List<string>();

if (SupportsSeparated)
if (SupportsCombined)
{
var combinedInfo = from i in combinedInformation
where i.Separate == Separate
where i.Combined == Combined
&& (i.IncludeXamMac == null || i.IncludeXamMac == IncludeXamMac)
select i.Text;
text.Add(combinedInfo.FirstOrDefault());
Expand Down
11 changes: 6 additions & 5 deletions src/Addins/Eto.Addin.Shared/ProjectWizardPageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,22 @@ public ProjectWizardPageView(ProjectWizardPageModel model)
content.AddRow(HeadingLabel((model.IsLibrary ? "Library" : "App") + " Name:"), label);
}

if (model.SupportsSeparated)
if (model.SupportsCombined)
{
var platformTypeList = new RadioButtonList
{
Orientation = Orientation.Vertical,
Spacing = radioSpacing,
Items =
{
new ListItem { Text = "Single Windows, Linux, and Mac desktop project", Key = "combined" },
new ListItem { Text = "Separate projects for each platform", Key = "separate" }
new ListItem { Text = "Separate projects for each platform", Key = "separate" },
new ListItem { Text = "Single Windows, Linux, and Mac desktop project", Key = "combined" }
}
};
platformTypeList.BindDataContext(c => c.Enabled, (ProjectWizardPageModel m) => m.AllowCombined);
platformTypeList.SelectedKeyBinding
.Convert(v => v == "separate", v => v ? "separate" : "combined")
.BindDataContext((ProjectWizardPageModel m) => m.Separate);
.Convert(v => v == "combined", v => v ? "combined" : "separate")
.BindDataContext((ProjectWizardPageModel m) => m.Combined);
content.AddRow(HeadingLabel("Launcher:"), platformTypeList);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />
<PropertyGroup>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
Expand All @@ -24,6 +25,7 @@
<DefaultNewProjectNode>CSharp\Eto.Forms</DefaultNewProjectNode>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetFrameworkProfile />
<TargetVsixContainerName>Eto.Addin.VisualStudio-$(InformationalVersion).vsix</TargetVsixContainerName>
</PropertyGroup>
<PropertyGroup>
<StartAction>Program</StartAction>
Expand Down Expand Up @@ -107,8 +109,8 @@
<Content Include="template.pkgdef">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\..\..\artifacts\nuget\$(Configuration)\Eto.Forms.Templates.2.5.0-dev.nupkg">
<Link>Eto.Forms.Templates.2.5.0-dev.nupkg</Link>
<Content Include="..\..\..\artifacts\nuget\$(Configuration)\Eto.Forms.Templates.$(InformationalVersion).nupkg">
<Link>Eto.Forms.Templates.$(InformationalVersion).nupkg</Link>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Resource Include="Templates\File-FSharp\File.ico" />
Expand Down
2 changes: 1 addition & 1 deletion src/Addins/Eto.Addin.VisualStudio/Templates/App-CSharp/App.vstemplate
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
<FullClassName>Microsoft.VisualStudio.TemplateEngine.Wizard.TemplateEngineWizard</FullClassName>
</WizardExtension>
<WizardData>
<SupportedParameters>Separated,Xeto,Jeto,Preview,XamMac</SupportedParameters>
<SupportedParameters>Combined,Xeto,Jeto,Preview,XamMac,Framework</SupportedParameters>
</WizardData>
</VSTemplate>
Loading

0 comments on commit c1b2bc2

Please sign in to comment.