浏览代码

Updating build pipeline

Sebastien Ros 8 年之前
父节点
当前提交
950959df26

+ 19 - 0
Common.props

@@ -0,0 +1,19 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup>
+    <Copyright>Sebastien Ros</Copyright>
+    <Authors>Sebastien Ros</Authors>
+    <VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <DebugType>portable</DebugType>
+    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
+    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
+    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
+    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
+    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
+  </PropertyGroup>
+
+</Project>

+ 4 - 3
Jint.Tests.CommonScripts/Jint.Tests.CommonScripts.csproj

@@ -25,9 +25,10 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
-    <PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
+    <PackageReference Include="xunit" Version="2.2.0" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
+    <PackageReference Include="xunit.analyzers" Version="0.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">

+ 8 - 0
Jint.Tests.Ecma/GlobalSuppressions.cs

@@ -0,0 +1,8 @@
+
+// This file is used by Code Analysis to maintain SuppressMessage 
+// attributes that are applied to this project.
+// Project-level suppressions either have no target or are given 
+// a specific target and scoped to a namespace, type, member, etc.
+
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1004:Test methods should not be skipped", Justification = "<Pending>", Scope = "module")]
+

+ 4 - 3
Jint.Tests.Ecma/Jint.Tests.Ecma.csproj

@@ -21,9 +21,10 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
-    <PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
+    <PackageReference Include="xunit" Version="2.2.0" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
+    <PackageReference Include="xunit.analyzers" Version="0.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">

+ 13 - 0
Jint.Tests/GlobalSuppressions.cs

@@ -0,0 +1,13 @@
+
+// This file is used by Code Analysis to maintain SuppressMessage 
+// attributes that are applied to this project.
+// Project-level suppressions either have no target or are given 
+// a specific target and scoped to a namespace, type, member, etc.
+
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Assertions", "xUnit2003:Do not use equality check to test for null value", Justification = "<Pending>", Scope = "module")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Assertions", "xUnit2004:Do not use equality check to test for boolean conditions", Justification = "<Pending>", Scope = "module")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1004:Test methods should not be skipped", Justification = "<Pending>", Scope = "module")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Assertions", "xUnit2000:Expected value should be first", Justification = "<Pending>", Scope = "module")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Assertions", "xUnit2007:Do not use typeof expression to check the type", Justification = "<Pending>", Scope = "module")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1014:MemberData should use nameof operator for member name", Justification = "<Pending>", Scope = "module")]
+

+ 4 - 3
Jint.Tests/Jint.Tests.csproj

@@ -25,9 +25,10 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
-    <PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
+    <PackageReference Include="xunit" Version="2.2.0" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
+    <PackageReference Include="xunit.analyzers" Version="0.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">

+ 23 - 0
Jint/Directory.Build.props

@@ -0,0 +1,23 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup>
+    <PackageId>Jint</PackageId>
+    <AssemblyTitle>Jint</AssemblyTitle>
+    <Description>Javascript interpreter for .NET which provides full ECMA 5.1 compliance.</Description>
+    <Description>Fluid is a template engine based on the Liquid markup, with focus on performance and .NET programming patterns.</Description>
+    <PackageTags>fluid;liquid;template;view engine</PackageTags>
+    <VersionPrefix>2.10.4</VersionPrefix>
+    <PackageId>Jint</PackageId>
+    <PackageTags>javascript, interpreter</PackageTags>
+    <PackageReleaseNotes>Fix package dependencies for .NET 4.5.</PackageReleaseNotes>
+    <PackageProjectUrl>https://github.com/sebastienros/jint</PackageProjectUrl>
+    <PackageLicenseUrl>https://raw.githubusercontent.com/sebastienros/jint/master/LICENSE.txt</PackageLicenseUrl>
+    <RepositoryType>git</RepositoryType>
+    <RepositoryUrl>git://github.com/sebastienros/jint</RepositoryUrl>
+    <NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
+  </PropertyGroup>
+
+  <!-- Called after so that the <VersionSuffix> is built after the local ones -->
+  <Import Project="../Common.props"/>
+
+</Project>

+ 1 - 14
Jint/Jint.csproj

@@ -1,25 +1,11 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <Description>Javascript interpreter for .NET which provides full ECMA 5.1 compliance.</Description>
-    <Copyright>Sebastien Ros</Copyright>
-    <AssemblyTitle>Jint</AssemblyTitle>
     <NeutralLanguage>en-US</NeutralLanguage>
     <VersionPrefix>2.10.4</VersionPrefix>
-    <Authors>Sebastien Ros</Authors>
     <TargetFrameworks>net40;net45;net451;netstandard1.3</TargetFrameworks>
-    <AssemblyName>Jint</AssemblyName>
     <AssemblyOriginatorKeyFile>Jint.snk</AssemblyOriginatorKeyFile>
     <SignAssembly>true</SignAssembly>
-    <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
-    <PackageId>Jint</PackageId>
-    <PackageTags>javascript, interpreter</PackageTags>
-    <PackageReleaseNotes>Fix package dependencies for .NET 4.5.</PackageReleaseNotes>
-    <PackageProjectUrl>https://github.com/sebastienros/jint</PackageProjectUrl>
-    <PackageLicenseUrl>https://raw.githubusercontent.com/sebastienros/jint/master/LICENSE.txt</PackageLicenseUrl>
-    <RepositoryType>git</RepositoryType>
-    <RepositoryUrl>git://github.com/sebastienros/jint</RepositoryUrl>
-    <NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
   </PropertyGroup>
 
   <ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' ">
@@ -33,6 +19,7 @@
     <PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
     <PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
     <PackageReference Include="System.Data.SqlClient" Version="4.3.0" />
+    <PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
     <PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
     <PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
     <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />

+ 0 - 1
Jint/Runtime/Interop/DelegateWrapper.cs

@@ -4,7 +4,6 @@ using System.Linq;
 using System.Reflection;
 using Jint.Native;
 using Jint.Native.Function;
-using System.Reflection;
 
 namespace Jint.Runtime.Interop
 {

+ 26 - 4
appveyor.yml

@@ -1,13 +1,35 @@
+image: Visual Studio 2017
 init:
   - git config --global core.autocrlf true
-clone_depth: 1
 install:
+  - ps: $env:BuildNumber= $env:APPVEYOR_BUILD_NUMBER
+  - ps: $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = true
+  - ps: $env:NUGET_XMLDOC_MODE = "skip"
+  - ps: $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
+build_script:
   - dotnet --version
   - dotnet restore
-build_script:
-  - dotnet build .\Jint\project.json --configuration Release
+  - dotnet build -c Release
+  - dotnet pack -c Release
 test_script:
   - dotnet test .\Jint.Tests\project.json --configuration Release -f netcoreapp1.0
   - dotnet test .\Jint.Tests.CommonScripts\project.json --configuration Release -f netcoreapp1.0
   - dotnet test .\Jint.Tests.Ecma\project.json --configuration Release -f netcoreapp1.0
-deploy: off
+artifacts:
+  - path: 'Jint\**\*.nupkg'
+  - provider: NuGet
+    on:
+      branch: dev
+    server: https://www.myget.org/F/jint/api/v2/package
+    api_key:
+      secure: 7PQvuxXn5P39X5QDlDKWbNpOKJKivpqkq7umakIirAZ12CSTAiCwjtJhSBGVboPm
+    skip_symbols: true
+    artifact: /.*\.nupkg/
+  - provider: NuGet
+    on:
+      branch: master
+    server: https://www.nuget.org/api/v2/package
+    api_key:
+      secure: dnqx6Im/Q6ODRS8fNWx8KgGmqv2bw1rQq/6PWgdvkUBGQAmE59tOZN2QzfMuy0NG
+    skip_symbols: true
+    artifact: /.*\.nupkg/