Skip to content

Commit

Permalink
Reorganized project, putting tests in a separate folder from packable…
Browse files Browse the repository at this point in the history
… projects. Added templates for Azure Devops, setup versioning with GitVersioning, and setup strong naming.
  • Loading branch information
NightOwl888 committed Jul 25, 2019
1 parent a91cfb5 commit 4028478
Show file tree
Hide file tree
Showing 3,197 changed files with 1,053 additions and 294 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
35 changes: 35 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project>
<Import Project="version.props" Condition="Exists('version.props')" />
<Import Project="build\dependencies.props" Condition="Exists('build\dependencies.props')" />

<PropertyGroup>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<PropertyGroup Label="Assembly Signing">
<AssemblyOriginatorKeyFile>$(RepositoryRoot)build/key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<PropertyGroup Label="NuGet Package Defaults">
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Label="Copyright Info">
<Company>ICU4N</Company>
<CurrentYear Condition=" '$(CurrentYear)' == '' ">$([System.DateTime]::UtcNow.Year.ToString())</CurrentYear>
<BeginCopyrightYear>2019</BeginCopyrightYear>
<CopyrightYearRange>$(BeginCopyrightYear) - $(CurrentYear)</CopyrightYearRange>
<CopyrightYearRange Condition=" '$(BeginCopyrightYear)' == '$(CurrentYear)' ">$(CurrentYear)</CopyrightYearRange>
<Copyright>Copyright © $(CopyrightYearRange) $(Company)</Copyright>
</PropertyGroup>

<!--
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning">
<Version>$(NerdBankGitVersioningPackageVersion)</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>-->
</Project>
133 changes: 133 additions & 0 deletions ICU4N.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29025.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGen", "CodeGen", "{57271E32-0E88-4696-A477-D00D99DF06F7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F0008007-6BDA-4F66-A01E-F559AD954127}"
ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml
build\dependencies.props = build\dependencies.props
build\nuget.props = build\nuget.props
build\TestReferences.Common.targets = build\TestReferences.Common.targets
build\TestTargetFramework.props = build\TestTargetFramework.props
version.json = version.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "azure-templates", "azure-templates", "{9A05917A-65A5-4E17-9A1E-8F180D557028}"
ProjectSection(SolutionItems) = preProject
build\azure-templates\build-pack-and-publish-libraries.yml = build\azure-templates\build-pack-and-publish-libraries.yml
build\azure-templates\publish-nuget-packages.yml = build\azure-templates\publish-nuget-packages.yml
build\azure-templates\publish-test-results-for-target-frameworks.yml = build\azure-templates\publish-test-results-for-target-frameworks.yml
build\azure-templates\publish-test-results-for-test-projects.yml = build\azure-templates\publish-test-results-for-test-projects.yml
build\azure-templates\publish-test-results.yml = build\azure-templates\publish-test-results.yml
build\azure-templates\run-tests-on-os.yml = build\azure-templates\run-tests-on-os.yml
build\azure-templates\show-all-environment-variables.yml = build\azure-templates\show-all-environment-variables.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CF2F2031-FCC4-401C-9D58-96D0245C1A41}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{543196C0-5AE0-40D8-8BE0-CDDD1F8C4DBB}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{8C266EC1-9565-4827-B3AD-AC657F6BDC27}"
ProjectSection(SolutionItems) = preProject
tests\Directory.Build.props = tests\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N", "src\ICU4N\ICU4N.csproj", "{883E16AF-AB40-4285-89A8-57333CC68AA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.Collation", "src\ICU4N.Collation\ICU4N.Collation.csproj", "{E2A01BE7-8163-41F9-A273-7EE38355E28F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.CurrencyData", "src\ICU4N.CurrencyData\ICU4N.CurrencyData.csproj", "{ACA48741-E35D-4EDD-9DF9-BA156B8D8919}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.LanguageData", "src\ICU4N.LanguageData\ICU4N.LanguageData.csproj", "{37098A9E-685A-4D56-9CCB-FDDE067FC9B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.RegionData", "src\ICU4N.RegionData\ICU4N.RegionData.csproj", "{3E3FB19F-186C-4198-8CDD-E80E53D64264}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.Transliterator", "src\ICU4N.Transliterator\ICU4N.Transliterator.csproj", "{88A90041-5B86-4526-B738-CD710FC68115}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.TestFramework", "tests\ICU4N.TestFramework\ICU4N.TestFramework.csproj", "{D1F71722-4424-430B-A39A-5F2E58471202}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.Tests", "tests\ICU4N.Tests\ICU4N.Tests.csproj", "{3D72AE06-7BB2-42B8-8772-D03053392AF5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.Tests.Collation", "tests\ICU4N.Tests.Collation\ICU4N.Tests.Collation.csproj", "{B384CCC9-55CA-452B-8C7B-12A38DFC9A95}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICU4N.Tests.Transliterator", "tests\ICU4N.Tests.Transliterator\ICU4N.Tests.Transliterator.csproj", "{F0C32D59-219F-47F4-830C-A724F7213A80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{883E16AF-AB40-4285-89A8-57333CC68AA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{883E16AF-AB40-4285-89A8-57333CC68AA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{883E16AF-AB40-4285-89A8-57333CC68AA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{883E16AF-AB40-4285-89A8-57333CC68AA2}.Release|Any CPU.Build.0 = Release|Any CPU
{E2A01BE7-8163-41F9-A273-7EE38355E28F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2A01BE7-8163-41F9-A273-7EE38355E28F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2A01BE7-8163-41F9-A273-7EE38355E28F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2A01BE7-8163-41F9-A273-7EE38355E28F}.Release|Any CPU.Build.0 = Release|Any CPU
{ACA48741-E35D-4EDD-9DF9-BA156B8D8919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACA48741-E35D-4EDD-9DF9-BA156B8D8919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACA48741-E35D-4EDD-9DF9-BA156B8D8919}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACA48741-E35D-4EDD-9DF9-BA156B8D8919}.Release|Any CPU.Build.0 = Release|Any CPU
{37098A9E-685A-4D56-9CCB-FDDE067FC9B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37098A9E-685A-4D56-9CCB-FDDE067FC9B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37098A9E-685A-4D56-9CCB-FDDE067FC9B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37098A9E-685A-4D56-9CCB-FDDE067FC9B8}.Release|Any CPU.Build.0 = Release|Any CPU
{3E3FB19F-186C-4198-8CDD-E80E53D64264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E3FB19F-186C-4198-8CDD-E80E53D64264}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E3FB19F-186C-4198-8CDD-E80E53D64264}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E3FB19F-186C-4198-8CDD-E80E53D64264}.Release|Any CPU.Build.0 = Release|Any CPU
{88A90041-5B86-4526-B738-CD710FC68115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88A90041-5B86-4526-B738-CD710FC68115}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88A90041-5B86-4526-B738-CD710FC68115}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88A90041-5B86-4526-B738-CD710FC68115}.Release|Any CPU.Build.0 = Release|Any CPU
{D1F71722-4424-430B-A39A-5F2E58471202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1F71722-4424-430B-A39A-5F2E58471202}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1F71722-4424-430B-A39A-5F2E58471202}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1F71722-4424-430B-A39A-5F2E58471202}.Release|Any CPU.Build.0 = Release|Any CPU
{3D72AE06-7BB2-42B8-8772-D03053392AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D72AE06-7BB2-42B8-8772-D03053392AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D72AE06-7BB2-42B8-8772-D03053392AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D72AE06-7BB2-42B8-8772-D03053392AF5}.Release|Any CPU.Build.0 = Release|Any CPU
{B384CCC9-55CA-452B-8C7B-12A38DFC9A95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B384CCC9-55CA-452B-8C7B-12A38DFC9A95}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B384CCC9-55CA-452B-8C7B-12A38DFC9A95}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B384CCC9-55CA-452B-8C7B-12A38DFC9A95}.Release|Any CPU.Build.0 = Release|Any CPU
{F0C32D59-219F-47F4-830C-A724F7213A80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0C32D59-219F-47F4-830C-A724F7213A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0C32D59-219F-47F4-830C-A724F7213A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0C32D59-219F-47F4-830C-A724F7213A80}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9A05917A-65A5-4E17-9A1E-8F180D557028} = {F0008007-6BDA-4F66-A01E-F559AD954127}
{883E16AF-AB40-4285-89A8-57333CC68AA2} = {543196C0-5AE0-40D8-8BE0-CDDD1F8C4DBB}
{E2A01BE7-8163-41F9-A273-7EE38355E28F} = {543196C0-5AE0-40D8-8BE0-CDDD1F8C4DBB}
{ACA48741-E35D-4EDD-9DF9-BA156B8D8919} = {543196C0-5AE0-40D8-8BE0-CDDD1F8C4DBB}
{37098A9E-685A-4D56-9CCB-FDDE067FC9B8} = {543196C0-5AE0-40D8-8BE0-CDDD1F8C4DBB}
{3E3FB19F-186C-4198-8CDD-E80E53D64264} = {543196C0-5AE0-40D8-8BE0-CDDD1F8C4DBB}
{88A90041-5B86-4526-B738-CD710FC68115} = {543196C0-5AE0-40D8-8BE0-CDDD1F8C4DBB}
{D1F71722-4424-430B-A39A-5F2E58471202} = {8C266EC1-9565-4827-B3AD-AC657F6BDC27}
{3D72AE06-7BB2-42B8-8772-D03053392AF5} = {8C266EC1-9565-4827-B3AD-AC657F6BDC27}
{B384CCC9-55CA-452B-8C7B-12A38DFC9A95} = {8C266EC1-9565-4827-B3AD-AC657F6BDC27}
{F0C32D59-219F-47F4-830C-A724F7213A80} = {8C266EC1-9565-4827-B3AD-AC657F6BDC27}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {083BF0D3-ED92-41EE-AD6E-6715D0BA155B}
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal
167 changes: 125 additions & 42 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,129 @@
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

jobs:
- job: Test
strategy:
matrix:
Windows:
osName: 'Windows'
imageName: 'windows-2019'
platform: 'netcoreapp2.1'
Linux:
osName: 'Linux'
imageName: 'ubuntu-16.04'
platform: 'netcoreapp2.1'
macOS:
osName: 'macOS'
imageName: 'macOS-10.14'
platform: 'netcoreapp2.1'
macOS2:
osName: 'macOS'
imageName: 'macOS-10.14'
platform: 'netcoreapp1.0'
displayName: 'Test $(platform) on'
pool:
vmImage: $(imageName)
steps:
- pwsh: Write-Host "Hello there"

- job: Test1
pool:
vmImage: 'windows-2019'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'

- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
- powershell: Start-Sleep -s 15
name: 'vNext$(rev:.r)' # Format for build number (will be overridden)

#trigger:
#- master

# DevOps Setup: Define the following pipeline level variables in Azure DevOps build pipeline
#
# ArtifactFeedID set to your Azure DevOps Artifact (NuGet) feed
# BuildConfiguration: 'Release'
# BuildPlatform: 'Any CPU'

variables:
- name: TestTargetFrameworks
value: 'netcoreapp2.0;netcoreapp1.0;net451'
- name: BinaryArtifactName
value: 'testbinaries'
- name: NuGetArtifactName
value: 'nuget'
- name: TestResultsArtifactName
value: 'testresults'
- name: VersionArtifactName
value: 'version'
- name: BuildNumberFileName
value: 'buildNumber.txt'
- name: PackageVersionFileName
value: 'packageVersion.txt'
- name: FileVersionFileName
value: 'fileVersion.txt'

stages:
- stage: Build_Stage
displayName: 'Build Stage:'
jobs:

- job: Build
pool:
vmImage: 'windows-2019'

steps:
- template: 'common/gitversioning-increment-and-persist-versions.yml@templates'
parameters:
versionArtifactName: '$(VersionArtifactName)'
packageVersionFileName: '$(PackageVersionFileName)'
fileVersionFileName: '$(FileVersionFileName)'
buildNumberFileName: '$(BuildNumberFileName)'

- template: 'class-libraries/build-pack-and-publish-libraries.yml@templates'
parameters:
artifactFeedID: '$(ArtifactFeedID)'
testTargetFrameworks: '$(TestTargetFrameworks)'
informationalVersion: '$(InformationalVersion)' # Output from gitversioning-increment-and-persist-versions.yml
fileVersion: '$(FileVersion)' # Output from gitversioning-increment-and-persist-versions.yml
assemblyVersion: '$(AssemblyVersion)' # Output from gitversioning-increment-and-persist-versions.yml
packageVersion: '$(PackageVersion)' # Output from gitversioning-increment-and-persist-versions.yml
buildConfiguration: '$(BuildConfiguration)'
buildPlatform: '$(BuildPlatform)'
nugetArtifactName: '$(NuGetArtifactName)'
binaryArtifactName: '$(BinaryArtifactName)'


- stage: Test_Stage
displayName: 'Test Stage:'
jobs:
- job: Test_netcoreapp2_0
strategy:
matrix:
Windows:
osName: 'Windows'
imageName: 'windows-2019'
maximumAllowedFailures: 8 # Maximum allowed failures for a successful build
Linux:
osName: 'Linux'
imageName: 'ubuntu-16.04'
maximumAllowedFailures: 8 # Maximum allowed failures for a successful build
macOS:
osName: 'macOS'
imageName: 'macOS-10.14'
maximumAllowedFailures: 8 # Maximum allowed failures for a successful build
displayName: 'Test netcoreapp2.0 on'
pool:
vmImage: $(imageName)
steps:
- template: 'build/azure-templates/run-tests-on-os.yml'
parameters:
osName: $(osName)
testTargetFrameworks: 'netcoreapp2.0'
testResultsArtifactName: '$(TestResultsArtifactName)'
- pwsh: Exit [int]([int]$TotalFailures -gt $(maximumAllowedFailures))

- job: Test_netcoreapp1_0
strategy:
matrix:
Windows:
osName: 'Windows'
imageName: 'windows-2019'
maximumAllowedFailures: 8 # Maximum allowed failures for a successful build
Linux:
osName: 'Linux'
imageName: 'ubuntu-16.04'
maximumAllowedFailures: 8 # Maximum allowed failures for a successful build
macOS:
osName: 'macOS'
imageName: 'macOS-10.14'
maximumAllowedFailures: 8 # Maximum allowed failures for a successful build
displayName: 'Test netcoreapp1.0 on'
pool:
vmImage: $(imageName)
steps:
- template: 'build/azure-templates/run-tests-on-os.yml'
parameters:
osName: $(osName)
testTargetFrameworks: 'netcoreapp1.0'
testResultsArtifactName: '$(TestResultsArtifactName)'
- pwsh: Exit [int]([int]$TotalFailures -gt $(maximumAllowedFailures))

- job: Test_net451
displayName: 'Test net451 on Windows'
pool:
vmImage: 'windows-2019'
steps:
- template: 'build/azure-templates/run-tests-on-os.yml'
parameters:
osName: $(osName)
testTargetFrameworks: 'net451'
testResultsArtifactName: '$(TestResultsArtifactName)'
- pwsh: Exit [int]([int]$TotalFailures -gt 8) # Maximum allowed failures for a successful build
12 changes: 12 additions & 0 deletions build/CommonAssemblyKeys.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace ICU4N
{
internal static class AssemblyKeys
{
public const string PublicKey =
"0024000004800000940000000602000000240000525341310004000001000100d12801609bb37c" +
"42c9aa2543be20a461d42954f501628392a51bd57254b0a7c11d7e5f5d8155b6cb732c1c00786a" +
"cc288202b0940f237a4a97948a37b6713713612d17cac30ff9bc10782334a72dce2326c768685e" +
"7ce2ab5335d61c22e6224a7beed58ab3cdba23b48d7ebbbe5c94bc90586e8eae358e1c915d082f" +
"36f961e2";
}
}
7 changes: 7 additions & 0 deletions build/TestReferences.Common.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<ItemGroup Label="Test Project Common References">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
<PackageReference Include="NUnit" Version="$(NUnitPackageVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnit3TestAdapterPackageVersion)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<PropertyGroup>
<!-- Changing this setting will allow testing on all target frameworks within Visual Studio 2017.
Note that the main libraries are multi-targeted, so this has no effect on how they are compiled,
this setting only affects the test projects. -->
<TargetFramework>net451</TargetFramework>
<!--<TargetFramework>net451</TargetFramework>-->
<!--<TargetFramework>netcoreapp1.0</TargetFramework>-->
<!--<TargetFramework>netcoreapp2.0</TargetFramework>-->
<TargetFramework>netcoreapp2.0</TargetFramework>

<!-- Allow the build script to pass in the test frameworks to build for.
This overrides the above TargetFramework setting.
LUCENENET TODO: Due to a parsing bug, we cannot pass a string with a ; to dotnet msbuild, so passing true as a workaround -->
<TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' ">netcoreapp2.0;netcoreapp1.0;net451</TargetFrameworks>
<TargetFrameworks Condition=" '$(TestTargetFrameworks)' == 'true' ">netcoreapp2.0;netcoreapp1.0;net451</TargetFrameworks>
<TargetFramework Condition=" '$(TargetFrameworks)' != '' "></TargetFramework>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 4028478

Please sign in to comment.