Skip to content

Commit bdbbe11

Browse files
committed
Update build script to use DNX stuff rather than MSBuild.
1 parent b099fb8 commit bdbbe11

File tree

13 files changed

+43
-130
lines changed

13 files changed

+43
-130
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Specific to this project
55
src/SharedAssemblyVersionInfo.cs
6+
project.lock.json
67

78
# User-specific files
89
*.suo

appveyor.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '{build}'
2+
image: Visual Studio 2015
3+
build_script:
4+
- ps: .\dev-build.ps1
5+
artifacts:
6+
- path: output\*.nupkg
7+
8+
# AppVeyor doesn't have native support for .NET Core tests yet
9+
test: off

build.proj

Lines changed: 0 additions & 91 deletions
This file was deleted.

dev-build.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

dev-build.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Checks that the last ran command returned with an exit code of 0
2+
function Assert-LastExitCode {
3+
if ($LASTEXITCODE -ne 0) {
4+
throw 'Non-zero exit code encountered'
5+
}
6+
}
7+
8+
# Use date in version number
9+
$env:DNX_BUILD_VERSION = Get-Date -format yyyyMMdd-HHmm
10+
11+
dotnet restore; Assert-LastExitCode
12+
# JSPool.Example.Web is a "legacy" csproj project, so NuGet packages need to be restored the old way too
13+
nuget restore src\JSPool.sln; Assert-LastExitCode
14+
& "${Env:ProgramFiles(x86)}\MSBuild\14.0\Bin\MSBuild.exe" src\JSPool.sln /t:rebuild /p:Configuration=Release; Assert-LastExitCode
15+
dotnet test tests\JSPool.Tests; Assert-LastExitCode
16+
dotnet pack src\JSPool -c Release --version-suffix "$env:DNX_BUILD_VERSION"; Assert-LastExitCode

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview2-003121"
5+
}
6+
}

release-build-push.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

release-build.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/JSPool.Example.Web/JSPool.Example.Web.csproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</Reference>
5656
<Reference Include="JSPool, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
5757
<SpecificVersion>False</SpecificVersion>
58-
<HintPath>..\JSPool\bin\Debug\net40\JSPool.dll</HintPath>
58+
<HintPath>..\JSPool\bin\$(Configuration)\net40-client\JSPool.dll</HintPath>
5959
</Reference>
6060
<Reference Include="Microsoft.CSharp" />
6161
<Reference Include="Microsoft.Web.Infrastructure">
@@ -113,9 +113,6 @@
113113
</Content>
114114
</ItemGroup>
115115
<ItemGroup>
116-
<Compile Include="..\SharedAssemblyVersionInfo.cs">
117-
<Link>Properties\SharedAssemblyVersionInfo.cs</Link>
118-
</Compile>
119116
<Compile Include="App_Start\JsPoolInitializer.cs" />
120117
<Compile Include="App_Start\RouteConfig.cs" />
121118
<Compile Include="Controllers\HomeController.cs" />
@@ -167,12 +164,6 @@
167164
</FlavorProperties>
168165
</VisualStudio>
169166
</ProjectExtensions>
170-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
171-
<PropertyGroup>
172-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
173-
</PropertyGroup>
174-
<Error Condition="!Exists('..\packages\JavaScriptEngineSwitcher.V8.1.5.2\build\JavaScriptEngineSwitcher.V8.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\JavaScriptEngineSwitcher.V8.1.5.2\build\JavaScriptEngineSwitcher.V8.props'))" />
175-
</Target>
176167
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
177168
Other similar extension points exist, see Microsoft.Common.targets.
178169
<Target Name="BeforeBuild">

src/JSPool.sln

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ EndProject
1111
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{8C26BA25-F911-4632-883E-838CFA5220FC}"
1212
ProjectSection(SolutionItems) = preProject
1313
..\.gitignore = ..\.gitignore
14-
..\build.proj = ..\build.proj
15-
..\dev-build.bat = ..\dev-build.bat
1614
..\LICENSE = ..\LICENSE
1715
..\README.md = ..\README.md
18-
..\release-build-push.bat = ..\release-build-push.bat
19-
..\release-build.bat = ..\release-build.bat
2016
EndProjectSection
2117
EndProject
2218
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JSPool.Example.Web", "JSPool.Example.Web\JSPool.Example.Web.csproj", "{9B7976EC-462F-4287-B545-C34D1601BB17}"
19+
ProjectSection(ProjectDependencies) = postProject
20+
{1FCDC650-03B8-49B0-938C-A06C4E06C50B} = {1FCDC650-03B8-49B0-938C-A06C4E06C50B}
21+
EndProjectSection
2322
EndProject
2423
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{D1BF49FA-FBDD-4AF6-A063-D191B78D399B}"
2524
EndProject

src/JSPool/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "JSPool facilitates easy integration of JavaScript scripting into a .NET application in a scalable and performant manner. It does so by creating a pool of engines that can be reused multiple times, making it easy to use JavaScript libraries that have long initialisation times without having to create a new engine every time.",
44
"version": "2.0.0-*",
55
"frameworks": {
6-
"net40-client": {}
6+
"net40-client": {},
7+
"net451": {}
78
},
89
"packOptions": {
910
"licenseUrl": "https://github.com/Daniel15/JSPool/blob/master/LICENSE",

tests/JSPool.Tests/JsPoolLoadTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public void ConcurrentGetAndReleaseEnginesIsSafe()
4949
thread.Start();
5050
}
5151

52-
threads[0].Join(10000);
52+
threads[0].Join();
5353
for (var i = 1; i < threads.Count; ++i)
5454
{
5555
Thread thread = threads[i];
56-
thread.Join(100);
56+
thread.Join();
5757
}
5858

5959
Assert.AreEqual(0, pool.EngineCount);

tests/JSPool.Tests/project.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"version": "1.0.0-*",
33
"dependencies": {
44
"dotnet-test-nunit": "3.4.0-beta-2",
5-
"JSPool": "2.0.0-*",
5+
"JSPool": {
6+
"target": "project"
7+
},
68
"Moq": "4.5.21",
79
"NUnit": "3.4.1"
810
},

0 commit comments

Comments
 (0)