Skip to content
Browse files

Added AMD Build Script

  • Loading branch information...
1 parent e8770d4 commit 202e887ba0553554e43f384370822ad0ddf01cfe na committed
View
31 README.md
@@ -8,8 +8,31 @@ This is a boilerplate app for using backbonejs, requirejs, and jQuery with TypeS
1. Download Visual Studio 2012 (I downloaded the premium release version, not sure if these instruction will work with express, RC , or Beta. Let me know if it does!)
2. Install the visual studio add-in for TypeScript here: http://www.microsoft.com/en-us/download/details.aspx?id=34790
3. If your using git then clone my project: git clone https://github.com/ntheile/TypeScript-Backbone-Require-Boilerplate.git
-4. *Note: I had to turn off VS2012 from compiling my code because I needed to to compile as ADM.
- a. right click the .ts file
- b. goto properties > build action > change to "none"
+4. *Note: I had to turn off VS2012 from compiling my code because I needed to to compile as AMD.
+ * right click the .ts file
+ * goto properties > build action > change to "none"
5. Now compile each manually using the commands in compile-notes.txt. Example> tsc app.ts --module AMD
- a. *Hint: Run the commands from the Package Manager Console in Visual Studio to avoid having to switch out to a DOS prompt
+ * *Hint: Run the commands from the Package Manager Console in Visual Studio to avoid having to switch out to a DOS prompt
+
+
+The Build Script
+=========================================================
+
+It's a pain to manually compile each ts file to use AMD so I wrote this batch script that you can configure to run at build time.
+
+`/TscAmdCompile.bat`
+
+<pre>
+"TypeScript is compiling as AMD using TscAmdCompile.bat"
+cd D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\js
+tsc.exe app.ts --module AMD
+cd models
+tsc.exe Todo.ts --module AMD
+</pre>
+
+To configure this to run at build time:
+**right click project > properties > build events > pre-build event command line > D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\TscAmdCompile.bat**
+
+_Make sure to keep the TscAmdCompile.bat file up to date when you add new .ts files._
+
+_You can ignore this build output message "'n++"TypeScript is compiling as AMD using TscAmdCompile.bat"' is not recognized as an internal or external command, operable program or batch file." I am not sure why VS inputs those weird characters, so the first line of the bat file is a dummy line_
View
BIN TypeScriptTest.v11.suo
Binary file not shown.
View
5 TypeScriptTest/TscAmdCompile.bat
@@ -0,0 +1,5 @@
+"TypeScript is compiling as AMD using TscAmdCompile.bat"
+cd D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\js
+tsc.exe app.ts --module AMD
+cd models
+tsc.exe Todo.ts --module AMD
View
4 TypeScriptTest/TypeScriptTest.csproj
@@ -42,6 +42,7 @@
<DependentUpon>Todo.ts</DependentUpon>
</Content>
<Content Include="web.config" />
+ <Content Include="TscAmdCompile.bat" />
<None Include="web.Release.config">
<DependentUpon>web.config</DependentUpon>
</None>
@@ -103,4 +104,7 @@
<Target Name="BeforeBuild">
<Exec Command="&quot;$(PROGRAMFILES)\Microsoft SDKs\TypeScript\0.8.0.0\tsc&quot; @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" />
</Target>
+ <PropertyGroup>
+ <PreBuildEvent>D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\TscAmdCompile.bat</PreBuildEvent>
+ </PropertyGroup>
</Project>
View
BIN TypeScriptTest/bin/TypeScriptTest.dll
Binary file not shown.
View
BIN TypeScriptTest/bin/TypeScriptTest.pdb
Binary file not shown.
View
2 TypeScriptTest/js/app.js
@@ -8,7 +8,7 @@ define(["require", "exports", "models/Todo"], function(require, exports, __Model
});
alert(task.get("content"));
$(document).ready(function () {
- alert("dom loaded");
+ alert("dom is loaded");
});
})
View
2 TypeScriptTest/js/app.ts
@@ -24,5 +24,5 @@ alert(task.get("content"));
//This simply shows that jQuery works. In Visual Studio you get intellisense since we referenced jquery.d.ts!!
$(document).ready(function () {
- alert("dom loaded");
+ alert("dom is loaded");
});
View
2 TypeScriptTest/js/models/Todo.js
@@ -16,7 +16,7 @@ define(["require", "exports"], function(require, exports) {
};
};
Todo.prototype.initialize = function () {
- alert("Todo init'ed.");
+ alert("Todo init'd.");
};
return Todo;
})(Backbone.Model);
View
2 TypeScriptTest/js/models/Todo.ts
@@ -14,7 +14,7 @@ export class Todo extends Backbone.Model {
};
initialize() {
- alert("Todo init'ed.");
+ alert("Todo init'd.");
};
};
View
BIN TypeScriptTest/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
View
5 TypeScriptTest/obj/Release/TypeScriptTest.csproj.FileListAbsolute.txt
@@ -3,3 +3,8 @@ D:\Websites\TypeScriptTest\TypeScriptTest\bin\TypeScriptTest.pdb
D:\Websites\TypeScriptTest\TypeScriptTest\obj\Release\TypeScriptTest.dll
D:\Websites\TypeScriptTest\TypeScriptTest\obj\Release\TypeScriptTest.pdb
D:\Websites\TypeScriptTest\TypeScriptTest\obj\Release\TypeScriptTest.csprojResolveAssemblyReference.cache
+D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\obj\Release\TypeScriptTest.dll
+D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\obj\Release\TypeScriptTest.pdb
+D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\bin\TypeScriptTest.dll
+D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\bin\TypeScriptTest.pdb
+D:\Websites\TypeScript-Backbone-Require-Boilerplate\TypeScriptTest\obj\Release\TypeScriptTest.csprojResolveAssemblyReference.cache
View
BIN TypeScriptTest/obj/Release/TypeScriptTest.dll
Binary file not shown.
View
BIN TypeScriptTest/obj/Release/TypeScriptTest.pdb
Binary file not shown.

0 comments on commit 202e887

Please sign in to comment.
Something went wrong with that request. Please try again.