Enable TypeScript files to be built with a simple "build typescript" and without taking a dependency on Node.js

This commit is contained in:
Bertrand Le Roy 2015-03-20 20:14:37 -07:00
parent 9f319e2a47
commit 39b4009e40
8 changed files with 33407 additions and 2 deletions

View File

@ -51,6 +51,7 @@
<Target Name="FullBuild"> <Target Name="FullBuild">
<CallTarget Targets="Clean"/> <CallTarget Targets="Clean"/>
<CallTarget Targets="TypeScript"/>
<CallTarget Targets="Compile"/> <CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/> <CallTarget Targets="Test"/>
<CallTarget Targets="Package"/> <CallTarget Targets="Package"/>
@ -128,6 +129,18 @@
Properties="Configuration=Release;OutputPath=$(MsBuildTasksFolder)" /> Properties="Configuration=Release;OutputPath=$(MsBuildTasksFolder)" />
</Target> </Target>
<Target Name="TypeScript" DependsOnTargets="CompileMsBuildTasks">
<ItemGroup>
<TypeScriptSources Include="$(SrcFolder)\**\Scripts\**\*.ts"/>
</ItemGroup>
<CompileTypeScriptFiles
InputFiles="@(TypeScriptSources)"
CompilerPath="$(LibFolder)\typescript\tsc.exe"
CompilerOptions="--target ES5">
<Output TaskParameter="OutputFiles" ItemName="Content" />
</CompileTypeScriptFiles>
</Target>
<!-- Testing --> <!-- Testing -->
<Target Name ="Test"> <Target Name ="Test">
@ -166,6 +179,7 @@
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FileUpdateLines" /> <UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FileUpdateLines" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.ValidateExtensionProjectFiles" /> <UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.ValidateExtensionProjectFiles" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.XmlDelete" /> <UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.XmlDelete" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.CompileTypeScriptFiles" />
<Target Name="Package-Stage" DependsOnTargets="Compile"> <Target Name="Package-Stage" DependsOnTargets="Compile">
<CallTarget Targets="CompileMsBuildTasks"/> <CallTarget Targets="CompileMsBuildTasks"/>
@ -249,10 +263,10 @@
<Copy SourceFiles="@(Stage-Modules-Binaries-Unique)" DestinationFiles="@(Stage-Modules-Binaries-Unique->'$(StageFolder)\Modules\%(ModuleName)\%(RecursiveDir)%(Filename)%(Extension)')"/> <Copy SourceFiles="@(Stage-Modules-Binaries-Unique)" DestinationFiles="@(Stage-Modules-Binaries-Unique->'$(StageFolder)\Modules\%(ModuleName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Modules-Sources)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)"/> <Copy SourceFiles="@(Stage-Modules-Sources)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Themes-Default)" DestinationFiles="@(Stage-Themes-Default->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/> <Copy SourceFiles="@(Stage-Themes-Default)" DestinationFiles="@(Stage-Themes-Default->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Themes-Custom)" DestinationFiles="@(Stage-Themes-Custom->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/> <Copy SourceFiles="@(Stage-Themes-Custom)" DestinationFiles="@(Stage-Themes-Custom->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Themes-Binaries-Unique)" DestinationFiles="@(Stage-Themes-Binaries-Unique->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/> <Copy SourceFiles="@(Stage-Themes-Binaries-Unique)" DestinationFiles="@(Stage-Themes-Binaries-Unique->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Themes-Sources)" DestinationFolder="$(StageFolder)\Themes\%(RecursiveDir)"/> <Copy SourceFiles="@(Stage-Themes-Sources)" DestinationFolder="$(StageFolder)\Themes\%(RecursiveDir)"/>
<MakeDir Directories="$(StageFolder)\App_Data"/> <MakeDir Directories="$(StageFolder)\App_Data"/>
<WriteLinesToFile File="$(StageFolder)\App_Data\_marker.txt" Lines="some_text" Overwrite="true"/> <WriteLinesToFile File="$(StageFolder)\App_Data\_marker.txt" Lines="some_text" Overwrite="true"/>

451
lib/typescript/License.htm Normal file
View File

@ -0,0 +1,451 @@
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<title>TypeScript for Microsoft Visual Studio</title>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:0in;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";}
h1
{mso-style-link:"Heading 1 Char";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:17.85pt;
text-indent:-17.85pt;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";}
h2
{mso-style-link:"Heading 2 Char";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:.5in;
text-indent:-18.15pt;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";}
a:link
{color:blue;
text-decoration:underline;}
a:visited
{color:purple;
text-decoration:underline;}
p.Body1, li.Body1, div.Body1
{mso-style-name:"Body 1";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:17.85pt;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";}
p.Bullet2, li.Bullet2, div.Bullet2
{mso-style-name:"Bullet 2";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:.5in;
text-indent:-18.15pt;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";}
p.Bullet3, li.Bullet3, div.Bullet3
{mso-style-name:"Bullet 3";
mso-style-link:"Bullet 3 Char1";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:53.85pt;
text-indent:-17.85pt;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";}
p.HeadingEULA, li.HeadingEULA, div.HeadingEULA
{mso-style-name:"Heading EULA";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:0in;
font-size:14.0pt;
font-family:"Tahoma","sans-serif";
font-weight:bold;}
p.HeadingSoftwareTitle, li.HeadingSoftwareTitle, div.HeadingSoftwareTitle
{mso-style-name:"Heading Software Title";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:0in;
border:none;
padding:0in;
font-size:14.0pt;
font-family:"Tahoma","sans-serif";
font-weight:bold;}
p.Preamble, li.Preamble, div.Preamble
{mso-style-name:Preamble;
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:0in;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";
font-weight:bold;}
span.Body2Char
{mso-style-name:"Body 2 Char";
font-family:"Tahoma","sans-serif";}
p.PreambleBorderAbove, li.PreambleBorderAbove, div.PreambleBorderAbove
{mso-style-name:"Preamble Border Above";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:6.0pt;
margin-left:0in;
border:none;
padding:0in;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";
font-weight:bold;}
p.Body0Bold, li.Body0Bold, div.Body0Bold
{mso-style-name:"Body 0 Bold";
mso-style-link:"Body 0 Bold Char";
margin:0in;
margin-bottom:.0001pt;
font-size:9.5pt;
font-family:"Tahoma","sans-serif";
font-weight:bold;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=WordSection1>
<p class=HeadingEULA><span style='font-family:"Segoe UI","sans-serif"'>MICROSOFT
PRE-RELEASE SOFTWARE LICENSE TERMS</span></p>
<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0in 0in 1.0pt 0in'>
<p class=HeadingSoftwareTitle><span style='font-family:"Segoe UI","sans-serif"'>TYPESCRIPT
FOR MICROSOFT VISUAL STUDIO</span></p>
</div>
<p class=Preamble><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'>These license terms are an agreement between Microsoft
Corporation (or based on where you live, one of its affiliates) and you. Please
read them. They apply to the pre-release software named above, which includes
the media on which you received it, if any. The terms also apply to any
Microsoft</span></p>
<p class=Bullet2 style='margin-left:.25in;text-indent:-.25in'><span
style='font-size:11.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>updates,</span></p>
<p class=Bullet2 style='margin-left:.25in;text-indent:-.25in'><span
style='font-size:11.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>supplements,</span></p>
<p class=Bullet2 style='margin-left:.25in;text-indent:-.25in'><span
style='font-size:11.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Internet-based
services, and</span></p>
<p class=Bullet2 style='margin-left:.25in;text-indent:-.25in'><span
style='font-size:11.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>support
services</span></p>
<p class=Preamble><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'>for this software, unless other terms accompany those items.
If so, those terms apply.</span></p>
<p class=Preamble><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>BY
USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT
USE THE SOFTWARE.</span></p>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:1.0pt 0in 0in 0in'>
<p class=PreambleBorderAbove><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>IF
YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.</span></p>
</div>
<h1><span style='font-size:10.0pt'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>INSTALLATION
AND USE RIGHTS. </span></h1>
<h2><span style='font-size:10.0pt'>a.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Installation
and Use.</span></h2>
<p class=Bullet3><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>You
may install and use any number of copies of the software on your devices solely
for evaluation purposes to design, develop and test your programs. </span></p>
<p class=Bullet3><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>You
may not test the software in a live operating environment unless Microsoft
permits you to do so under another agreement.</span></p>
<h2><span style='font-size:10.0pt'>b.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Third
Party Programs.</span><span class=Body2Char><span style='font-size:11.0pt;
font-family:"Segoe UI","sans-serif";font-weight:normal'> The software may
include third party programs that Microsoft, not the third party, licenses to
you under this agreement. Notices, if any, for the third party program are
included for your information only.</span></span></h2>
<h1><span style='font-size:10.0pt'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>TERM.</span><span
style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";font-weight:normal'>
The term of this agreement is until 31 December 2015.</span></h1>
<h1><span style='font-size:10.0pt'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>PRE-RELEASE
SOFTWARE. </span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'>This software is a pre-release version. It may not work the
way a final version of the software will. We may change it for the final,
commercial version. We also may not release a commercial version.</span></h1>
<h1><span style='font-size:10.0pt'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>FEEDBACK.
</span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'>If you give feedback about the software to Microsoft, you
give to Microsoft, without charge, the right to use, share and commercialize
your feedback in any way and for any purpose. You also give to third parties,
without charge, any patent rights needed for their products, technologies and
services to use or interface with any specific parts of a Microsoft software or
service that includes the feedback. You will not give feedback that is subject
to a license that requires Microsoft to license its software or documentation
to third parties because we include your feedback in them. These rights survive
this agreement.</span></h1>
<h1><span style='font-size:10.0pt'>5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>SCOPE
OF LICENSE.</span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'> The software is licensed, not sold. This agreement only
gives you some rights to use the software. Microsoft reserves all other rights.
Unless applicable law gives you more rights despite this limitation, you may
use the software only as expressly permitted in this agreement. In doing so,
you must comply with any technical limitations in the software that only allow
you to use it in certain ways. You may not</span></h1>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>disclose
the results of any benchmark tests of the software to any third party without
Microsofts prior written approval;</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>work
around any technical limitations in the software;</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>reverse
engineer, decompile or disassemble the software, except and only to the extent
that applicable law expressly permits, despite this limitation;</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>make
more copies of the software than specified in this agreement or allowed by
applicable law, despite this limitation;</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>publish
the software for others to copy;</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>rent,
lease or lend the software;</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>transfer
the software or this agreement to any third party; or</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>use
the software for commercial software hosting services.</span></p>
<h1><span class=MsoHyperlink><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext;text-decoration:none'>6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>EXPORT
RESTRICTIONS.</span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'> The software is subject to United States export laws and
regulations. You must comply with all domestic and international export laws
and regulations that apply to the software. These laws include restrictions on
destinations, end users and end use. For additional information, see <a href="http://www.microsoft.com/exporting">http://www.microsoft.com/exporting</a></span>.</span></h1>
<h1><span style='font-size:10.0pt'>7.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>SUPPORT
SERVICES. </span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'>Because this software is “as is,” we may not provide
support services for it.</span></h1>
<h1><span style='font-size:10.0pt'>8.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>ENTIRE
AGREEMENT.</span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'> This agreement, and the terms for supplements, updates,
Internet-based services and support services that you use, are the entire
agreement for the software and support services.</span></h1>
<h1 style='margin-left:.25in;text-indent:-.25in'><span style='font-size:10.0pt'>9.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></span><span
style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>APPLICABLE LAW.</span></h1>
<h2><span style='font-size:10.0pt'>a.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>United
States.</span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'> If you acquired the software in the United States,
Washington state law governs the interpretation of this agreement and applies
to claims for breach of it, regardless of conflict of laws principles. The laws
of the state where you live govern all other claims, including claims under
state consumer protection laws, unfair competition laws, and in tort.</span></h2>
<h2><span style='font-size:10.0pt'>b.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Outside
the United States.</span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'> If you acquired the software in any other country, the
laws of that country apply.</span></h2>
<h1><span style='font-size:10.0pt'>10.<span style='font:7.0pt "Times New Roman"'>&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>LEGAL
EFFECT.</span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'> This agreement describes certain legal rights. You may
have other rights under the laws of your country. You may also have rights with
respect to the party from whom you acquired the software. This agreement does
not change your rights under the laws of your country if the laws of your
country do not permit it to do so.</span></h1>
<h1><span style='font-size:10.0pt'>11.<span style='font:7.0pt "Times New Roman"'>&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>DISCLAIMER
OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT.
MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE
ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH
THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS,
MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT.</span></h1>
<p class=Body1><b><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>FOR
AUSTRALIA YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND
NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.</span></b></p>
<h1><span style='font-size:10.0pt'>12.<span style='font:7.0pt "Times New Roman"'>&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>LIMITATION
ON AND EXCLUSION OF REMEDIES AND DAMAGES</span><span style='font-size:11.0pt;
font-family:"Segoe UI","sans-serif"'>. YOU CAN RECOVER FROM MICROSOFT AND ITS
SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER
DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL
DAMAGES.</span></h1>
<p class=Body1><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>This
limitation applies to</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>anything
related to the software, services, content (including code) on third party
Internet sites, or third party programs; and</span></p>
<p class=Bullet2><span style='font-size:11.0pt;font-family:Symbol'>·<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>claims
for breach of contract, breach of warranty, guarantee or condition, strict
liability, negligence, or other tort to the extent permitted by applicable law.</span></p>
<p class=MsoNormal style='margin-left:.25in'><span style='font-size:11.0pt;
font-family:"Segoe UI","sans-serif"'>It also applies even if Microsoft knew or
should have known about the possibility of the damages. The above limitation or
exclusion may not apply to you because your country may not allow the exclusion
or limitation of incidental, consequential or other damages.</span></p>
<p class=MsoNormal style='margin-left:.25in'><span style='font-size:11.0pt;
font-family:"Segoe UI","sans-serif"'>&nbsp;</span></p>
<p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Please
note: As this software is distributed in Quebec, Canada, some of the clauses in
this agreement are provided below in French.</span></b></p>
<p class=MsoNormal><b><span lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Remarque
: Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce
contrat sont fournies ci-dessous en français.</span></b></p>
<p class=MsoNormal><b><span lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>EXONÉRATION
DE GARANTIE.</span></b><span lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>
Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de
ce logiciel est à votre seule risque et péril. Microsoft naccorde aucune autre
garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du
droit local sur la protection des consommateurs, que ce contrat ne peut
modifier. La ou elles sont permises par le droit locale, les garanties
implicites de qualité marchande, dadéquation à un usage particulier et
dabsence de contrefaçon sont exclues.</span></p>
<p class=MsoNormal><b><span lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>LIMITATION
DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES.</span></b><span
lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'> Vous
pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de
dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à
aucune indemnisation pour les autres dommages, y compris les dommages spéciaux,
indirects ou accessoires et pertes de bénéfices.</span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Cette
limitation concerne :</span></p>
<p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'><span lang=FR
style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>tout ce qui est
relié au logiciel, aux services ou au contenu (y compris le code) figurant sur
des sites Internet tiers ou dans des programmes tiers ; et</span></p>
<p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'><span lang=FR
style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>les réclamations
au titre de violation de contrat ou de garantie, ou au titre de responsabilité
stricte, de négligence ou dune autre faute dans la limite autorisée par la loi
en vigueur.</span></p>
<p class=MsoNormal><span lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>Elle
sapplique également, même si Microsoft connaissait ou devrait connaître
léventualité dun tel dommage. Si votre pays nautorise pas lexclusion ou la
limitation de responsabilité pour les dommages indirects, accessoires ou de
quelque nature que ce soit, il se peut que la limitation ou lexclusion
ci-dessus ne sappliquera pas à votre égard.</span></p>
<p class=Body0Bold style='margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
margin-left:0in'><span lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif"'>EFFET
JURIDIQUE.</span><span lang=FR style='font-size:11.0pt;font-family:"Segoe UI","sans-serif";
font-weight:normal'> Le présent contrat décrit certains droits juridiques. Vous
pourriez avoir dautres droits prévus par les lois de votre pays. Le présent
contrat ne modifie pas les droits que vous confèrent les lois de votre pays si
celles-ci ne le permettent pas.</span></p>
</div>
</body>
</html>

14219
lib/typescript/lib.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
lib/typescript/tsc.exe Normal file

Binary file not shown.

18496
lib/typescript/tsc.js Normal file

File diff suppressed because one or more lines are too long

BIN
lib/typescript/tschost.dll Normal file

Binary file not shown.

View File

@ -68,6 +68,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="TypeScriptFiles.cs" />
<Compile Include="XmlDelete.cs" /> <Compile Include="XmlDelete.cs" />
<Compile Include="ValidateExtensionProjectFiles.cs" /> <Compile Include="ValidateExtensionProjectFiles.cs" />
<Compile Include="FileUpdateLines.cs" /> <Compile Include="FileUpdateLines.cs" />

View File

@ -0,0 +1,224 @@
// From https://msbuildtypescript.codeplex.com/, included under apache 2.0
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace MSBuild.Orchard.Tasks {
public class CompileTypeScriptFiles : Task {
private static readonly Regex errorLineMatcher = new Regex(@"^(?'file'.*\.ts) *\((?'lineNumber'\d+),(?'columnNumber'\d+)\) *: *(?'message'.*)$");
public CompileTypeScriptFiles() {
ChildProcessTimeout = 60000;
}
public string CompilerPath { get; set; }
public string CompilerOptions { get; set; }
public bool OverwriteReadOnlyFiles { get; set; }
public int ChildProcessTimeout { get; set; }
[Required]
public ITaskItem[] InputFiles { get; set; }
[Output]
public ITaskItem[] OutputFiles { get; set; }
public override bool Execute() {
var compilerPath = CompilerPath ?? "tsc";
var compilerOptions = CompilerOptions ?? string.Empty;
var inputFiles = ReferenceOrderer.OrderFiles(InputFiles ?? new ITaskItem[0]);
var outputFiles = inputFiles
.SelectMany(item => new[] {
TaskItemWithNewExtension(item, ".js"),
TaskItemWithNewExtension(item, ".js.map")
})
.ToArray();
var success = true;
var singleOutputFile = GetSingleOutputFile(compilerOptions);
if (singleOutputFile != null)
outputFiles = new ITaskItem[] {
new TaskItem(singleOutputFile),
new TaskItem(singleOutputFile + ".map")
};
if (OverwriteReadOnlyFiles) {
var readOnlyFiles =
from item in outputFiles
let file = new FileInfo(item.ItemSpec)
where file.Exists && file.IsReadOnly
select file;
foreach (var file in readOnlyFiles) {
file.IsReadOnly = false;
}
}
if (outputFiles.Length > 0) {
var startInfo =
new ProcessStartInfo {
FileName = compilerPath,
Arguments = string.Join(" ", new[] {compilerOptions}.Concat(inputFiles.Select(item => Quote(item.ItemSpec)))),
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true,
};
var process = Process.Start(startInfo);
if (process == null) {
Log.LogError("TypeScript process failed to start.");
return false;
}
var processOutput = new ProcessOutput(process);
if (!process.WaitForExit(ChildProcessTimeout)) {
Log.LogError("Timeout waiting for child process to finish.");
success = false;
}
if (success && process.ExitCode != 0) {
success = false;
foreach (var line in processOutput.Lines) {
var errorLineMatch = errorLineMatcher.Match(line);
if (errorLineMatch.Success) {
var file = new FileInfo(errorLineMatch.Groups["file"].Value).FullName;
var lineNumber = int.Parse(errorLineMatch.Groups["lineNumber"].Value);
var columnNumber = int.Parse(errorLineMatch.Groups["columnNumber"].Value) + 1;
var message = errorLineMatch.Groups["message"].Value;
Log.LogError(null, null, null, file, lineNumber, columnNumber, 0, 0, message);
}
else
Log.LogWarning(line);
}
Log.LogError("Typescript compiler exited with code " + process.ExitCode);
}
}
OutputFiles = outputFiles.Where(item => File.Exists(item.ItemSpec)).ToArray();
return success;
}
private static string GetSingleOutputFile(string compilerOptions) {
var singleOutputFileMatch = Regex.Match(compilerOptions, @"--out\s+(?'file'(""[^""]*"")|([^\s]*))");
if (!singleOutputFileMatch.Success)
return null;
var singleOutputFile = singleOutputFileMatch.Groups["file"].Value;
if (singleOutputFile.StartsWith("\"") && singleOutputFile.EndsWith("\""))
singleOutputFile = singleOutputFile.Substring(1, singleOutputFile.Length - 2);
return singleOutputFile;
}
private static string Quote(string s) {
return '"' + s + '"';
}
private static ITaskItem TaskItemWithNewExtension(ITaskItem item, string extension) {
var newItem = new TaskItem(Path.ChangeExtension(item.ItemSpec, extension));
item.CopyMetadataTo(newItem);
return newItem;
}
private class ProcessOutput {
private readonly List<string> _lines = new List<string>();
public ProcessOutput(Process process) {
process.ErrorDataReceived += (sender, e) => DataReceived(e.Data);
process.BeginErrorReadLine();
process.OutputDataReceived += (sender, e) => DataReceived(e.Data);
process.BeginOutputReadLine();
}
private void DataReceived(string data) {
if (data == null)
return;
lock (_lines) {
_lines.Add(data);
}
}
public IEnumerable<string> Lines {
get {
lock (_lines) {
return _lines.ToArray();
}
}
}
}
private static class ReferenceOrderer {
private static readonly Regex referencePattern = new Regex(@"^\s*///\s*<reference.*path=('|"")(?'path'.*)(\1)\s*/>\s*$", RegexOptions.Multiline);
public static ITaskItem[] OrderFiles(IEnumerable<ITaskItem> inputFiles) {
var fileLookup = inputFiles.ToDictionary(ToReference);
var orderedFileReferences = new List<string>();
foreach (var fileReference in fileLookup.Keys)
AddFileAndReferencedFiles(fileReference, orderedFileReferences, fileLookup, Enumerable.Empty<string>());
return orderedFileReferences.Select(f => fileLookup[f]).ToArray();
}
private static void AddFileAndReferencedFiles(string fileReference, ICollection<string> orderedFileReferences, IDictionary<string, ITaskItem> fileLookup, IEnumerable<string> callStack) {
if (orderedFileReferences.Contains(fileReference))
return;
var callStackArray = callStack as IList<string> ?? callStack.ToList();
var callStackForNested = callStackArray.Concat(new[] {fileReference}).ToList();
if (callStackArray.Contains(fileReference)) {
Trace.WriteLine(string.Format("Reference loop detected '{0}'", string.Join("', '", callStackForNested)));
return;
}
foreach (var nestedFileReference in ReadReferences(fileLookup[fileReference]).Where(fileLookup.ContainsKey)) {
AddFileAndReferencedFiles(nestedFileReference, orderedFileReferences, fileLookup, callStackForNested);
}
orderedFileReferences.Add(fileReference);
}
private static IEnumerable<string> ReadReferences(ITaskItem inputFile) {
var file = new FileInfo(inputFile.ItemSpec);
if (file.Directory == null) return new string[] {};
return
referencePattern
.Matches(File.ReadAllText(file.FullName))
.Cast<Match>()
.Select(match => file.Directory != null
? new FileInfo(Path.Combine(file.Directory.FullName, match.Groups["path"].Value))
: null)
.Select(ToReference);
}
private static string ToReference(ITaskItem inputFile) {
return ToReference(new FileInfo(inputFile.ItemSpec));
}
private static string ToReference(FileInfo file) {
return Path.ChangeExtension(file.FullName, null);
}
}
}
}