Skip to content

Commit

Permalink
Add 'Sample Project' project template
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Oct 15, 2014
1 parent 37cd492 commit 23f9923
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 0 deletions.
7 changes: 7 additions & 0 deletions DanTup.DartVS.Vsix/DanTup.DartVS.Vsix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<VSIXSubPath>ItemTemplates</VSIXSubPath>
</ProjectReference>
<ProjectReference Include="..\Templates\Project\DartSampleProjectTemplate\DartSampleProjectTemplate.csproj">
<Project>{ca6fda9f-403a-4f63-a215-99079864819a}</Project>
<Name>DartSampleProjectTemplate</Name>
<IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<VSIXSubPath>ProjectTemplates</VSIXSubPath>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Condition="Exists($(VsSdkTargets))" Project="$(VsSdkTargets)" />
Expand Down
8 changes: 8 additions & 0 deletions DanTup.DartVS.Vsix/VSPackage.resx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@
<value>An empty class definition</value>
<comment>Item template description</comment>
</data>
<data name="2100" xml:space="preserve">
<value>Sample Project</value>
<comment>Project template name</comment>
</data>
<data name="2101" xml:space="preserve">
<value>A project for creating a sample Dart project</value>
<comment>Project template description</comment>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="4500" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>resources\dart.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
Expand Down
1 change: 1 addition & 0 deletions DanTup.DartVS.Vsix/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
<Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" d:ProjectName="DartClassItemTemplate" d:TargetPath="|DartClassItemTemplate;TemplateProjectOutputGroup|" Path="ItemTemplates" d:VsixSubPath="ItemTemplates" />
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="Project" d:ProjectName="DartSampleProjectTemplate" d:TargetPath="|DartSampleProjectTemplate;TemplateProjectOutputGroup|" Path="ProjectTemplates" d:VsixSubPath="ProjectTemplates" />
</Assets>
</PackageManifest>
10 changes: 10 additions & 0 deletions DanTup.DartVS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Item", "Item", "{24723645-E020-4404-8C34-4F1219FCAA58}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{1F55ABC4-E076-434F-BD98-D60C81451C81}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DartClassItemTemplate", "Templates\Item\DartClassItemTemplate\DartClassItemTemplate.csproj", "{4371E445-C653-4470-BECF-7F69870725F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DartSampleProjectTemplate", "Templates\Project\DartSampleProjectTemplate\DartSampleProjectTemplate.csproj", "{CA6FDA9F-403A-4F63-A215-99079864819A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -98,12 +102,18 @@ Global
{4371E445-C653-4470-BECF-7F69870725F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4371E445-C653-4470-BECF-7F69870725F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4371E445-C653-4470-BECF-7F69870725F3}.Release|Any CPU.Build.0 = Release|Any CPU
{CA6FDA9F-403A-4F63-A215-99079864819A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA6FDA9F-403A-4F63-A215-99079864819A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA6FDA9F-403A-4F63-A215-99079864819A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA6FDA9F-403A-4F63-A215-99079864819A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{24723645-E020-4404-8C34-4F1219FCAA58} = {41302908-B8A3-43B3-BEDF-4429B57644D2}
{1F55ABC4-E076-434F-BD98-D60C81451C81} = {41302908-B8A3-43B3-BEDF-4429B57644D2}
{4371E445-C653-4470-BECF-7F69870725F3} = {24723645-E020-4404-8C34-4F1219FCAA58}
{CA6FDA9F-403A-4F63-A215-99079864819A} = {1F55ABC4-E076-434F-BD98-D60C81451C81}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>$guid1$</ProjectGuid>
<OutputType>jar</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>$safeprojectname$</RootNamespace>
<AssemblyName>$safeprojectname$</AssemblyName>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>All</DebugSymbols>
<ShowWarnings>True</ShowWarnings>
<ShowAllWarnings>True</ShowAllWarnings>
<TreatWarningsAsErrors>None</TreatWarningsAsErrors>
<WarningsAsErrors />
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>Default</DebugSymbols>
<ShowWarnings>True</ShowWarnings>
<ShowAllWarnings>True</ShowAllWarnings>
<TreatWarningsAsErrors>None</TreatWarningsAsErrors>
<WarningsAsErrors />
<OutputPath>bin\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="bin\echo.dart"/>
<Compile Include="bin\print_day.dart"/>
<Compile Include="lib\hello.dart"/>
<Compile Include="test\all.dart"/>
<Compile Include="test\run_in_browser.dart"/>
<Compile Include="web\main.dart"/>
</ItemGroup>
<ItemGroup>
<Content Include="test\index.html"/>
<Content Include="web\index.html"/>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name Package="{bbdbd7c7-5505-4e81-915a-fa178bb27617}" ID="2100"/>
<Description Package="{bbdbd7c7-5505-4e81-915a-fa178bb27617}" ID="2101"/>
<Icon Package="{bbdbd7c7-5505-4e81-915a-fa178bb27617}" ID="4500"/>
<TemplateID>DartVS.Dart.SampleProject</TemplateID>
<ProjectType>Dart</ProjectType>
<SortOrder>20</SortOrder>
<CreateNewFolder>true</CreateNewFolder>
<DefaultName>DartSample</DefaultName>
<ProvideDefaultName>true</ProvideDefaultName>
</TemplateData>
<TemplateContent>
<Project File="DartSampleProject.dartproj" ReplaceParameters="true">
<Folder Name="dart_bin" TargetFolderName="bin">
<ProjectItem ReplaceParameters="true">echo.dart</ProjectItem>
<ProjectItem ReplaceParameters="true">print_day.dart</ProjectItem>
</Folder>
<Folder Name="lib">
<ProjectItem ReplaceParameters="true">hello.dart</ProjectItem>
</Folder>
<Folder Name="test">
<ProjectItem ReplaceParameters="true">all.dart</ProjectItem>
<ProjectItem ReplaceParameters="true">index.html</ProjectItem>
<ProjectItem ReplaceParameters="true">run_in_browser.dart</ProjectItem>
</Folder>
<Folder Name="web">
<ProjectItem ReplaceParameters="true">index.html</ProjectItem>
<ProjectItem ReplaceParameters="true">main.dart</ProjectItem>
</Folder>
</Project>
</TemplateContent>
<!--<WizardExtension>
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
</WizardExtension>
<WizardData>
<packages repository="extension" repositoryId="d4032879-2378-4ea2-abc4-cb0fa4b9941e">
<package id="DartVS.Dart" version="1.0.0-alpha001" />
</packages>
</WizardData>-->
</VSTemplate>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CA6FDA9F-403A-4F63-A215-99079864819A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DartSampleProjectTemplate</RootNamespace>
<AssemblyName>DartSampleProjectTemplate</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CreateVsixContainer>false</CreateVsixContainer>
<DeployExtension>false</DeployExtension>
<DeployVSTemplates>false</DeployVSTemplates>
<CopyVsixManifestToOutput>false</CopyVsixManifestToOutput>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="DartSampleProject.dartproj" />
<None Include="dart_bin\echo.dart" />
<None Include="dart_bin\print_day.dart" />
<None Include="lib\hello.dart" />
<None Include="test\all.dart" />
<Content Include="test\index.html" />
<None Include="test\run_in_browser.dart" />
<None Include="web\main.dart" />
</ItemGroup>
<ItemGroup>
<VSTemplate Include="DartSampleProject.vstemplate">
<OutputSubPath>Samples</OutputSubPath>
</VSTemplate>
</ItemGroup>
<ItemGroup>
<Content Include="web\index.html" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" Condition="false" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DartSampleProjectTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DartSampleProjectTemplate")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3bc8b3d6-5d9e-4419-8e9e-489128f1d4e9")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
15 changes: 15 additions & 0 deletions Templates/Project/DartSampleProjectTemplate/dart_bin/echo.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'dart:io';

main() {
print('');
print('');
print('Welcome to echo!');
print('');
print('Type a message and press <ENTER>.');
print('');

while (true) {
stdout.write('> ');
print(' ' + stdin.readLineSync());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:intl/intl.dart';

var dayFormatter = new DateFormat.EEEE();

main() {
var day = dayFormatter.format(new DateTime.now());
print('');
print('Today is $day');
print('');
}
2 changes: 2 additions & 0 deletions Templates/Project/DartSampleProjectTemplate/lib/hello.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Hello {
}
38 changes: 38 additions & 0 deletions Templates/Project/DartSampleProjectTemplate/test/all.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'dart:async';
import 'package:unittest/unittest.dart';

void main() {
test('Passing top-level #1', () {
expect(1, equals(1));
});

group('Sync tests', () {
test('Passing sync test', () {
expect(1, equals(1));
});

test('Failing sync test #1', () {
expect(1, equals(2));
});
});

group('Async tests', () {
test('Passing async test', () {
new Future.delayed(new Duration(seconds: 1), expectAsync(() {
expect(1, equals(1));
}));
});

test('Passing slow async test', () {
new Future.delayed(new Duration(seconds: 5), expectAsync(() {
expect(1, equals(1));
}));
});

test('Failing async test', () {
new Future.delayed(new Duration(seconds: 1), expectAsync(() {
expect(1, equals(2));
}));
});
});
}
10 changes: 10 additions & 0 deletions Templates/Project/DartSampleProjectTemplate/test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Test Dart Webpage</title>
</head>
<body>
<script type="application/dart" src="run_in_browser.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'all.dart' as tests;
import 'package:unittest/html_config.dart';

main() {
useHtmlConfiguration();
tests.main();
}
10 changes: 10 additions & 0 deletions Templates/Project/DartSampleProjectTemplate/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Test Dart Webpage</title>
</head>
<body>
<script type="application/dart" src="main.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions Templates/Project/DartSampleProjectTemplate/web/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'dart:html';

main() {
document.body.append(new DivElement()..text = 'Hello from Dart!');
}

0 comments on commit 23f9923

Please sign in to comment.