Create a Stylet.Start NuGet package

This commit is contained in:
Antony Male 2015-12-21 17:37:54 +00:00
parent b320514d29
commit 06eedc101f
8 changed files with 116 additions and 25 deletions

27
NuGet/Stylet.Start.nuspec Normal file
View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>Stylet.Start</id>
<version>1.1.8</version>
<title>Stylet.Start</title>
<authors>Antony Male</authors>
<owners>Antony Male</owners>
<licenseUrl>http://github.com/canton7/Stylet/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>http://github.com/canton7/Stylet</projectUrl>
<iconUrl>https://raw.githubusercontent.com/canton7/Stylet/master/StyletIcon.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A quick startup project for Stylet</description>
<copyright>Copyright 2015 Antony Male</copyright>
<tags>Stylet WPF MVVM ViewModel Screen Conductor ViewModel-First Model-View-ViewModel UI</tags>
<dependencies>
<group>
<dependency id="Stylet" version="[1.1.8]"/>
</group>
</dependencies>
</metadata>
<files>
<file src="start\content\**" target="content" />
</files>
</package>

View File

@ -0,0 +1,13 @@
<Application x:Class="$rootnamespace$.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:$rootnamespace$"
xmlns:s="https://github.com/canton7/Stylet">
<Application.Resources>
<s:ApplicationLoader>
<s:ApplicationLoader.Bootstrapper>
<local:Bootstrapper/>
</s:ApplicationLoader.Bootstrapper>
</s:ApplicationLoader>
</Application.Resources>
</Application>

View File

@ -0,0 +1,23 @@
using Stylet;
using $rootnamespace$.Pages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace $rootnamespace$
{
public class Bootstrapper : Bootstrapper<ShellViewModel>
{
protected override void ConfigureIoC(IStyletIoCBuilder builder)
{
// Configure the IoC container in here
}
protected override void Configure()
{
// Perform any other configuration before the application starts
}
}
}

View File

@ -0,0 +1,19 @@
<Window x:Class="$rootnamespace$.Pages.ShellView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:$rootnamespace$.Pages"
xmlns:s="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance local:ShellView}"
Title="Stylet Start Project"
Width="200" Height="200">
<Grid>
<TextBlock FontSize="20"
HorizontalAlignment="Center"
VerticalAlignment="Center">
Hello Stylet!
</TextBlock>
</Grid>
</Window>

View File

@ -0,0 +1,13 @@
using Stylet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace $rootnamespace$.Pages
{
public class ShellViewModel : Screen
{
}
}

View File

@ -19,31 +19,21 @@ Stylet's aims to:
It is inspired by [Caliburn.Micro](http://www.caliburnproject.org/), and shares many of its concepts, but removes most of the magic (replacing it with more powerful alternatives), and simplifies parts considerably by targeting only MVVM, WPF and .NET 4.5.
Documentation
-------------
Getting Started
---------------
[The wiki is the official documentation source](https://github.com/canton7/Stylet/wiki).
There's a lot of documentation there, and it's being added to all the time.
Go check it out!
The quickest way to get started is to create a new `WPF Application` project, then install the NuGet package [`Stylet.Start`](https://www.nuget.org/packages/Stylet.Start).
This will install Stylet, and set up a simple skeleton project.
See [Quick Start](https://github.com/canton7/Stylet/wiki/Quick-Start) for more details.
If you want to set up your project manually, install the [Stylet](https://www.nuget.org/packages/Stylet) package, then follow the instructions in the [Quick Start](https://github.com/canton7/Stylet/wiki/Quick-Start).
Stylet requires .NET 4.5 (Visual Studio 2012 or higher).
Installation
------------
You can either grab Stylet through NuGet, or build it from source yourself.
Stylet does rely on .NET 4.5 (Visual Studio 2012 or higher).
### NuGet
[Stylet is available on NuGet](https://www.nuget.org/packages/Stylet).
Either open the package console and type:
```
PM> Install-Package Stylet
```
Or right-click your project -> Manage NuGet Packages -> Search for Stylet
Symbols
------
The source is also available when you are debugging, using [GitLink](https://github.com/GitTools/GitLink).
Go to Debug -> Options and Settings -> General, and make the following changes:

View File

@ -5,6 +5,7 @@ COVERAGE_FILE = File.join(COVERAGE_DIR, 'coverage.xml')
GITLINK_REMOTE = 'https://github.com/canton7/stylet'
NUSPEC = 'NuGet/Stylet.nuspec'
NUSPEC_START = 'NuGet/Stylet.start.nuspec'
ASSEMBLY_INFO = 'Stylet/Properties/AssemblyInfo.cs'
@ -100,6 +101,9 @@ task :package do
Dir.chdir(File.dirname(NUSPEC)) do
sh "nuget.exe pack #{File.basename(NUSPEC)}"
end
Dir.chdir(File.dirname(NUSPEC_START)) do
sh "nuget.exe pack #{File.basename(NUSPEC_START)}"
end
end
desc "Bump version number"
@ -116,6 +120,11 @@ task :version, [:version] do |t, args|
content = IO.read(NUSPEC)
content[/<version>(.+?)<\/version>/, 1] = args[:version]
File.open(NUSPEC, 'w'){ |f| f.write(content) }
content = IO.read(NUSPEC_START)
content[/<version>(.+?)<\/version>/, 1] = args[:version]
content[%r{<dependency id="Stylet" version="\[(.+?)\]"/>}, 1] = args[:version]
File.open(NUSPEC_START, 'w'){ |f| f.write(content) }
end
desc "Extract StyletIoC as a standalone file"

View File

@ -1,3 +0,0 @@
Welcome to Stylet! Stylet is a small but powerful MVVM framework, which supports a ViewModel-First approach.
Please read the documentation at https://github.com/canton7/Stylet/wiki