trackler 2.0.8.18 → 2.0.8.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/.gitignore +1 -0
- data/common/.travis.yml +5 -8
- data/common/README.md +18 -5
- data/common/exercises/grep/canonical-data.json +290 -269
- data/common/exercises/phone-number/canonical-data.json +2 -2
- data/common/exercises/pov/canonical-data.json +2 -5
- data/common/exercises/roman-numerals/canonical-data.json +112 -74
- data/common/exercises/tournament/canonical-data.json +86 -85
- data/common/exercises/two-bucket/canonical-data.json +55 -47
- data/common/package.json +16 -0
- data/common/yarn.lock +195 -0
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/docs/LEARNING.md +1 -1
- data/tracks/c/exercises/space-age/src/example.c +15 -47
- data/tracks/c/exercises/space-age/src/example.h +12 -8
- data/tracks/c/exercises/space-age/test/test_space_age.c +8 -8
- data/tracks/ceylon/docs/TESTS.md +5 -2
- data/tracks/ceylon/exercises/TRACK_HINTS.md +5 -2
- data/tracks/csharp/.gitignore +0 -4
- data/tracks/csharp/.travis.yml +9 -20
- data/tracks/csharp/appveyor.yml +2 -4
- data/tracks/csharp/build.cake +95 -0
- data/tracks/csharp/build.ps1 +189 -0
- data/tracks/csharp/build.sh +99 -31
- data/tracks/csharp/circle.yml +3 -12
- data/tracks/delphi/config.json +8 -0
- data/tracks/delphi/exercises/minesweeper/MineSweeper.dpr +60 -0
- data/tracks/delphi/exercises/minesweeper/uMineSweeperExample.pas +70 -0
- data/tracks/delphi/exercises/minesweeper/uMineSweeperTest.pas +270 -0
- data/tracks/dlang/config.json +86 -31
- data/tracks/elixir/config.json +7 -0
- data/tracks/elixir/exercises/rotational-cipher/example.exs +35 -0
- data/tracks/elixir/exercises/rotational-cipher/rotational_cipher.exs +13 -0
- data/tracks/elixir/exercises/rotational-cipher/rotational_cipher_test.exs +80 -0
- data/tracks/go/exercises/raindrops/raindrops_test.go +4 -1
- data/tracks/go/exercises/react/react_test.go +6 -8
- data/tracks/go/exercises/rna-transcription/rna_transcription_test.go +4 -1
- data/tracks/go/exercises/robot-simulator/robot_simulator_test.go +5 -2
- data/tracks/haskell/exercises/allergies/src/Allergies.hs +2 -2
- data/tracks/haskell/exercises/atbash-cipher/src/Atbash.hs +2 -2
- data/tracks/haskell/exercises/bank-account/src/BankAccount.hs +3 -3
- data/tracks/haskell/exercises/binary-search-tree/src/BST.hs +7 -7
- data/tracks/haskell/exercises/bowling/src/Bowling.hs +1 -1
- data/tracks/haskell/exercises/clock/src/Clock.hs +4 -4
- data/tracks/haskell/exercises/connect/src/Connect.hs +1 -1
- data/tracks/haskell/exercises/crypto-square/src/CryptoSquare.hs +1 -1
- data/tracks/haskell/exercises/custom-set/src/CustomSet.hs +12 -12
- data/tracks/haskell/exercises/difference-of-squares/src/Squares.hs +3 -3
- data/tracks/haskell/exercises/etl/src/ETL.hs +1 -1
- data/tracks/haskell/exercises/forth/src/Forth.hs +2 -2
- data/tracks/haskell/exercises/go-counting/src/Counting.hs +2 -2
- data/tracks/haskell/exercises/kindergarten-garden/src/Garden.hs +3 -3
- data/tracks/haskell/exercises/largest-series-product/src/Series.hs +1 -1
- data/tracks/haskell/exercises/lens-person/src/Person.hs +4 -4
- data/tracks/julia/.travis.yml +3 -2
- data/tracks/ocaml/exercises/all-your-base/test.ml +2 -2
- data/tracks/ocaml/exercises/beer-song/test.ml +25 -24
- data/tracks/ocaml/exercises/phone-number/test.ml +22 -22
- data/tracks/ocaml/exercises/run-length-encoding/test.ml +5 -5
- data/tracks/ocaml/exercises/word-count/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/beer-song/template.ml +20 -1
- data/tracks/purescript/config.json +7 -0
- data/tracks/purescript/exercises/word-count/bower.json +17 -0
- data/tracks/purescript/exercises/word-count/examples/src/WordCount.purs +31 -0
- data/tracks/purescript/exercises/word-count/src/WordCount.purs +3 -0
- data/tracks/purescript/exercises/word-count/test/Main.purs +89 -0
- data/tracks/python/exercises/accumulate/accumulate.py +2 -0
- data/tracks/python/exercises/acronym/acronym.py +2 -0
- data/tracks/python/exercises/allergies/allergies.py +3 -0
- data/tracks/python/exercises/allergies/example.py +1 -1
- data/tracks/python/exercises/anagram/anagram.py +2 -0
- data/tracks/python/exercises/atbash-cipher/atbash_cipher.py +6 -0
- data/tracks/python/exercises/beer-song/beer_song.py +6 -0
- data/tracks/python/exercises/binary-search/binary_search.py +2 -0
- data/tracks/python/exercises/binary/binary.py +2 -0
- data/tracks/python/exercises/bob/bob.py +2 -8
- data/tracks/python/exercises/bracket-push/bracket_push.py +2 -0
- data/tracks/python/exercises/circular-buffer/circular_buffer.py +11 -0
- data/tracks/python/exercises/clock/clock.py +3 -0
- data/tracks/python/exercises/clock/example.py +1 -1
- data/tracks/python/exercises/crypto-square/crypto_square.py +2 -0
- data/tracks/python/exercises/diamond/diamond.py +2 -0
- data/tracks/python/exercises/difference-of-squares/difference_of_squares.py +10 -0
- data/tracks/python/exercises/etl/etl.py +2 -0
- data/tracks/python/exercises/flatten-array/flatten_array.py +2 -0
- data/tracks/python/exercises/gigasecond/gigasecond.py +2 -0
- data/tracks/python/exercises/grade-school/grade_school.py +3 -0
- data/tracks/python/exercises/grains/grains.py +6 -0
- data/tracks/python/exercises/hamming/hamming.py +2 -0
- data/tracks/python/exercises/hello-world/hello_world.py +2 -7
- data/tracks/python/exercises/hexadecimal/hexadecimal.py +2 -0
- data/tracks/python/exercises/house/house.py +6 -0
- data/tracks/python/exercises/kindergarten-garden/kindergarten_garden.py +3 -0
- data/tracks/python/exercises/largest-series-product/largest_series_product.py +2 -0
- data/tracks/python/exercises/leap/leap.py +2 -0
- data/tracks/python/exercises/linked-list/linked_list.py +2 -8
- data/tracks/python/exercises/list-ops/list_ops.py +18 -22
- data/tracks/python/exercises/luhn/luhn.py +3 -0
- data/tracks/python/exercises/matrix/matrix.py +3 -0
- data/tracks/python/exercises/meetup/meetup.py +2 -0
- data/tracks/python/exercises/minesweeper/minesweeper.py +2 -0
- data/tracks/python/exercises/nth-prime/nth_prime.py +2 -0
- data/tracks/python/exercises/nucleotide-count/nucleotide_count.py +6 -0
- data/tracks/python/exercises/ocr-numbers/ocr_numbers.py +6 -0
- data/tracks/python/exercises/ocr-numbers/{ocr_test.py → ocr_numbers_test.py} +0 -0
- data/tracks/python/exercises/octal/octal.py +2 -0
- data/tracks/python/exercises/palindrome-products/palindrome_products.py +6 -0
- data/tracks/python/exercises/pangram/pangram.py +2 -0
- data/tracks/python/exercises/pascals-triangle/pascals_triangle.py +10 -0
- data/tracks/python/exercises/perfect-numbers/perfect_numbers.py +6 -0
- data/tracks/python/exercises/phone-number/phone_number.py +3 -0
- data/tracks/python/exercises/pig-latin/pig_latin.py +2 -0
- data/tracks/python/exercises/point-mutations/point_mutations.py +2 -0
- data/tracks/python/exercises/poker/poker.py +2 -0
- data/tracks/python/exercises/prime-factors/prime_factors.py +2 -0
- data/tracks/python/exercises/proverb/proverb.py +2 -0
- data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet.py +10 -0
- data/tracks/python/exercises/queen-attack/queen_attack.py +6 -0
- data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher.py +10 -0
- data/tracks/python/exercises/raindrops/raindrops.py +2 -0
- data/tracks/python/exercises/rectangles/example.py +1 -1
- data/tracks/python/exercises/rectangles/rectangles.py +2 -0
- data/tracks/python/exercises/rectangles/{rectangles_count_test.py → rectangles_test.py} +0 -0
- data/tracks/python/exercises/rna-transcription/rna_transcription.py +2 -0
- data/tracks/python/exercises/robot-name/robot_name.py +3 -0
- data/tracks/python/exercises/robot-simulator/robot_simulator.py +3 -0
- data/tracks/python/exercises/roman-numerals/roman_numerals.py +2 -0
- data/tracks/python/exercises/run-length-encoding/run_length_encoding.py +6 -0
- data/tracks/python/exercises/run-length-encoding/{run_length_test.py → run_length_encoding_test.py} +1 -1
- data/tracks/python/exercises/saddle-points/saddle_points.py +2 -0
- data/tracks/python/exercises/say/example.py +1 -1
- data/tracks/python/exercises/say/say.py +2 -0
- data/tracks/python/exercises/say/say_test.py +3 -0
- data/tracks/python/exercises/scrabble-score/scrabble_score.py +2 -0
- data/tracks/python/exercises/secret-handshake/secret_handshake.py +6 -0
- data/tracks/python/exercises/secret-handshake/{handshake_test.py → secret_handshake_test.py} +0 -0
- data/tracks/python/exercises/series/series.py +2 -0
- data/tracks/python/exercises/sieve/sieve.py +2 -0
- data/tracks/python/exercises/simple-cipher/example.py +1 -1
- data/tracks/python/exercises/simple-cipher/simple_cipher.py +8 -0
- data/tracks/python/exercises/space-age/space_age.py +3 -0
- data/tracks/python/exercises/strain/strain.py +6 -0
- data/tracks/python/exercises/sublist/sublist.py +2 -0
- data/tracks/python/exercises/sum-of-multiples/sum_of_multiples.py +2 -0
- data/tracks/python/exercises/triangle/triangle.py +7 -0
- data/tracks/python/exercises/trinary/trinary.py +2 -0
- data/tracks/python/exercises/twelve-days/twelve_days.py +10 -0
- data/tracks/python/exercises/word-count/word_count.py +2 -0
- data/tracks/python/exercises/wordy/wordy.py +2 -0
- data/tracks/python/exercises/zebra-puzzle/zebra_puzzle.py +2 -0
- data/tracks/ruby/exercises/beer-song/.meta/.version +1 -0
- data/tracks/ruby/exercises/beer-song/beer_song_test.rb +62 -36
- data/tracks/ruby/exercises/beer-song/example.rb +1 -5
- data/tracks/ruby/exercises/beer-song/example.tt +22 -0
- data/tracks/ruby/lib/beer_song_cases.rb +43 -0
- data/tracks/swift/exercises/matrix/Tests/MatrixTests/MatrixTests.swift +1 -1
- metadata +94 -13
- data/common/bin/jsonlint +0 -27
- data/tracks/csharp/.paket/paket.bootstrapper.exe +0 -0
- data/tracks/csharp/Zipper.cs +0 -137
- data/tracks/csharp/build.cmd +0 -14
- data/tracks/csharp/build.fsx +0 -78
- data/tracks/csharp/paket.dependencies +0 -2
- data/tracks/csharp/paket.lock +0 -3
data/tracks/csharp/appveyor.yml
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
- ps: (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/F/E/5FEB7E95-C643-48D5-8329-9D2C63676CE8/dotnet-dev-win-x64.1.0.0-rc4-004771.exe', "c:/dotnet-install.exe")
|
3
|
-
- cmd: c:\dotnet-install.exe /install /quiet
|
1
|
+
image: Visual Studio 2017
|
4
2
|
build_script:
|
5
|
-
- ps:
|
3
|
+
- ps: ./build.ps1
|
6
4
|
environment:
|
7
5
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
8
6
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
@@ -0,0 +1,95 @@
|
|
1
|
+
#addin "Cake.FileHelpers"
|
2
|
+
|
3
|
+
var target = Argument("target", "Default");
|
4
|
+
|
5
|
+
var sourceDir = "./exercises";
|
6
|
+
var buildDir = "./build";
|
7
|
+
|
8
|
+
var defaultSln = buildDir + "/Exercises.Default.sln";
|
9
|
+
var allSln = buildDir + "/Exercises.All.sln";
|
10
|
+
var refactoringSln = buildDir + "/Exercises.Refactoring.sln";
|
11
|
+
|
12
|
+
var dotNetCoreBuildSettings = new DotNetCoreBuildSettings { NoIncremental = true };
|
13
|
+
|
14
|
+
Task("Clean")
|
15
|
+
.Does(() => {
|
16
|
+
CleanDirectory(buildDir);
|
17
|
+
});
|
18
|
+
|
19
|
+
// Copy everything to build so we make no changes in the actual files.
|
20
|
+
Task("CopyExercises")
|
21
|
+
.IsDependentOn("Clean")
|
22
|
+
.Does(() => {
|
23
|
+
CopyDirectory(sourceDir, buildDir);
|
24
|
+
});
|
25
|
+
|
26
|
+
Task("RestoreNugetPackages")
|
27
|
+
.IsDependentOn("CopyExercises")
|
28
|
+
.Does(() => {
|
29
|
+
DotNetCoreRestore(allSln);
|
30
|
+
});
|
31
|
+
|
32
|
+
Task("BuildStubImplementations")
|
33
|
+
.IsDependentOn("RestoreNugetPackages")
|
34
|
+
.Does(() => {
|
35
|
+
DotNetCoreBuild(defaultSln, dotNetCoreBuildSettings);
|
36
|
+
});
|
37
|
+
|
38
|
+
Task("EnableAllTests")
|
39
|
+
.IsDependentOn("BuildStubImplementations")
|
40
|
+
.Does(() => {
|
41
|
+
var testFiles = buildDir + "/*/*Test.cs";
|
42
|
+
var skipRegex = @"Skip\s*=\s*""Remove to run test""";
|
43
|
+
ReplaceRegexInFiles(testFiles, skipRegex, "");
|
44
|
+
});
|
45
|
+
|
46
|
+
Task("TestRefactoringProjects")
|
47
|
+
.IsDependentOn("EnableAllTests")
|
48
|
+
.Does(() => {
|
49
|
+
DotNetCoreBuild(refactoringSln, dotNetCoreBuildSettings);
|
50
|
+
|
51
|
+
// These projects have a working default implementation, and have
|
52
|
+
// all the tests enabled. These should pass without any changes.
|
53
|
+
var refactoringProjects =
|
54
|
+
GetFiles(buildDir + "/*/TreeBuilding.csproj")
|
55
|
+
+ GetFiles(buildDir + "/*/Ledger.csproj")
|
56
|
+
+ GetFiles(buildDir + "/*/Markdown.csproj");
|
57
|
+
|
58
|
+
foreach (var refactoringProject in refactoringProjects) {
|
59
|
+
DotNetCoreTest(refactoringProject.FullPath);
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
Task("ReplaceStubWithExample")
|
64
|
+
.IsDependentOn("TestRefactoringProjects")
|
65
|
+
.Does(() => {
|
66
|
+
var allProjects = GetFiles(buildDir + "/*/*.csproj");
|
67
|
+
|
68
|
+
foreach (var project in allProjects) {
|
69
|
+
var projectDir = project.GetDirectory();
|
70
|
+
var projectName = project.GetFilenameWithoutExtension();
|
71
|
+
var stub = projectDir.GetFilePath(projectName).AppendExtension("cs");
|
72
|
+
var example = projectDir.GetFilePath("Example.cs");
|
73
|
+
|
74
|
+
DeleteFile(stub);
|
75
|
+
MoveFile(example, stub);
|
76
|
+
}
|
77
|
+
});
|
78
|
+
|
79
|
+
Task("TestUsingExampleImplementation")
|
80
|
+
.IsDependentOn("ReplaceStubWithExample")
|
81
|
+
.Does(() => {
|
82
|
+
DotNetCoreBuild(allSln, dotNetCoreBuildSettings);
|
83
|
+
|
84
|
+
var allProjects = GetFiles(buildDir + "/*/*.csproj");
|
85
|
+
|
86
|
+
foreach (var project in allProjects) {
|
87
|
+
DotNetCoreTest(project.FullPath);
|
88
|
+
}
|
89
|
+
});
|
90
|
+
|
91
|
+
Task("Default")
|
92
|
+
.IsDependentOn("TestUsingExampleImplementation")
|
93
|
+
.Does(() => { });
|
94
|
+
|
95
|
+
RunTarget(target);
|
@@ -0,0 +1,189 @@
|
|
1
|
+
##########################################################################
|
2
|
+
# This is the Cake bootstrapper script for PowerShell.
|
3
|
+
# This file was downloaded from https://github.com/cake-build/resources
|
4
|
+
# Feel free to change this file to fit your needs.
|
5
|
+
##########################################################################
|
6
|
+
|
7
|
+
<#
|
8
|
+
|
9
|
+
.SYNOPSIS
|
10
|
+
This is a Powershell script to bootstrap a Cake build.
|
11
|
+
|
12
|
+
.DESCRIPTION
|
13
|
+
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
|
14
|
+
and execute your Cake build script with the parameters you provide.
|
15
|
+
|
16
|
+
.PARAMETER Script
|
17
|
+
The build script to execute.
|
18
|
+
.PARAMETER Target
|
19
|
+
The build script target to run.
|
20
|
+
.PARAMETER Configuration
|
21
|
+
The build configuration to use.
|
22
|
+
.PARAMETER Verbosity
|
23
|
+
Specifies the amount of information to be displayed.
|
24
|
+
.PARAMETER Experimental
|
25
|
+
Tells Cake to use the latest Roslyn release.
|
26
|
+
.PARAMETER WhatIf
|
27
|
+
Performs a dry run of the build script.
|
28
|
+
No tasks will be executed.
|
29
|
+
.PARAMETER Mono
|
30
|
+
Tells Cake to use the Mono scripting engine.
|
31
|
+
.PARAMETER SkipToolPackageRestore
|
32
|
+
Skips restoring of packages.
|
33
|
+
.PARAMETER ScriptArgs
|
34
|
+
Remaining arguments are added here.
|
35
|
+
|
36
|
+
.LINK
|
37
|
+
http://cakebuild.net
|
38
|
+
|
39
|
+
#>
|
40
|
+
|
41
|
+
[CmdletBinding()]
|
42
|
+
Param(
|
43
|
+
[string]$Script = "build.cake",
|
44
|
+
[string]$Target = "Default",
|
45
|
+
[ValidateSet("Release", "Debug")]
|
46
|
+
[string]$Configuration = "Release",
|
47
|
+
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
|
48
|
+
[string]$Verbosity = "Verbose",
|
49
|
+
[switch]$Experimental,
|
50
|
+
[Alias("DryRun","Noop")]
|
51
|
+
[switch]$WhatIf,
|
52
|
+
[switch]$Mono,
|
53
|
+
[switch]$SkipToolPackageRestore,
|
54
|
+
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
|
55
|
+
[string[]]$ScriptArgs
|
56
|
+
)
|
57
|
+
|
58
|
+
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
|
59
|
+
function MD5HashFile([string] $filePath)
|
60
|
+
{
|
61
|
+
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
|
62
|
+
{
|
63
|
+
return $null
|
64
|
+
}
|
65
|
+
|
66
|
+
[System.IO.Stream] $file = $null;
|
67
|
+
[System.Security.Cryptography.MD5] $md5 = $null;
|
68
|
+
try
|
69
|
+
{
|
70
|
+
$md5 = [System.Security.Cryptography.MD5]::Create()
|
71
|
+
$file = [System.IO.File]::OpenRead($filePath)
|
72
|
+
return [System.BitConverter]::ToString($md5.ComputeHash($file))
|
73
|
+
}
|
74
|
+
finally
|
75
|
+
{
|
76
|
+
if ($file -ne $null)
|
77
|
+
{
|
78
|
+
$file.Dispose()
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
Write-Host "Preparing to run build script..."
|
84
|
+
|
85
|
+
if(!$PSScriptRoot){
|
86
|
+
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
|
87
|
+
}
|
88
|
+
|
89
|
+
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
|
90
|
+
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
|
91
|
+
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
|
92
|
+
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
|
93
|
+
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
|
94
|
+
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
|
95
|
+
|
96
|
+
# Should we use mono?
|
97
|
+
$UseMono = "";
|
98
|
+
if($Mono.IsPresent) {
|
99
|
+
Write-Verbose -Message "Using the Mono based scripting engine."
|
100
|
+
$UseMono = "-mono"
|
101
|
+
}
|
102
|
+
|
103
|
+
# Should we use the new Roslyn?
|
104
|
+
$UseExperimental = "";
|
105
|
+
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
|
106
|
+
Write-Verbose -Message "Using experimental version of Roslyn."
|
107
|
+
$UseExperimental = "-experimental"
|
108
|
+
}
|
109
|
+
|
110
|
+
# Is this a dry run?
|
111
|
+
$UseDryRun = "";
|
112
|
+
if($WhatIf.IsPresent) {
|
113
|
+
$UseDryRun = "-dryrun"
|
114
|
+
}
|
115
|
+
|
116
|
+
# Make sure tools folder exists
|
117
|
+
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
|
118
|
+
Write-Verbose -Message "Creating tools directory..."
|
119
|
+
New-Item -Path $TOOLS_DIR -Type directory | out-null
|
120
|
+
}
|
121
|
+
|
122
|
+
# Make sure that packages.config exist.
|
123
|
+
if (!(Test-Path $PACKAGES_CONFIG)) {
|
124
|
+
Write-Verbose -Message "Downloading packages.config..."
|
125
|
+
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
|
126
|
+
Throw "Could not download packages.config."
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
# Try find NuGet.exe in path if not exists
|
131
|
+
if (!(Test-Path $NUGET_EXE)) {
|
132
|
+
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
|
133
|
+
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) }
|
134
|
+
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
|
135
|
+
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
|
136
|
+
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
|
137
|
+
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
# Try download NuGet.exe if not exists
|
142
|
+
if (!(Test-Path $NUGET_EXE)) {
|
143
|
+
Write-Verbose -Message "Downloading NuGet.exe..."
|
144
|
+
try {
|
145
|
+
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
|
146
|
+
} catch {
|
147
|
+
Throw "Could not download NuGet.exe."
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
# Save nuget.exe path to environment to be available to child processed
|
152
|
+
$ENV:NUGET_EXE = $NUGET_EXE
|
153
|
+
|
154
|
+
# Restore tools from NuGet?
|
155
|
+
if(-Not $SkipToolPackageRestore.IsPresent) {
|
156
|
+
Push-Location
|
157
|
+
Set-Location $TOOLS_DIR
|
158
|
+
|
159
|
+
# Check for changes in packages.config and remove installed tools if true.
|
160
|
+
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
|
161
|
+
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
|
162
|
+
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
|
163
|
+
Write-Verbose -Message "Missing or changed package.config hash..."
|
164
|
+
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
|
165
|
+
}
|
166
|
+
|
167
|
+
Write-Verbose -Message "Restoring tools from NuGet..."
|
168
|
+
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
|
169
|
+
|
170
|
+
if ($LASTEXITCODE -ne 0) {
|
171
|
+
Throw "An error occured while restoring NuGet tools."
|
172
|
+
}
|
173
|
+
else
|
174
|
+
{
|
175
|
+
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
|
176
|
+
}
|
177
|
+
Write-Verbose -Message ($NuGetOutput | out-string)
|
178
|
+
Pop-Location
|
179
|
+
}
|
180
|
+
|
181
|
+
# Make sure that Cake has been installed.
|
182
|
+
if (!(Test-Path $CAKE_EXE)) {
|
183
|
+
Throw "Could not find Cake.exe at $CAKE_EXE"
|
184
|
+
}
|
185
|
+
|
186
|
+
# Start Cake
|
187
|
+
Write-Host "Running build script..."
|
188
|
+
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
|
189
|
+
exit $LASTEXITCODE
|
data/tracks/csharp/build.sh
CHANGED
@@ -1,33 +1,101 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
##########################################################################
|
4
|
+
# This is the Cake bootstrapper script for Linux and OS X.
|
5
|
+
# This file was downloaded from https://github.com/cake-build/resources
|
6
|
+
# Feel free to change this file to fit your needs.
|
7
|
+
##########################################################################
|
8
|
+
|
9
|
+
# Define directories.
|
10
|
+
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
11
|
+
TOOLS_DIR=$SCRIPT_DIR/tools
|
12
|
+
NUGET_EXE=$TOOLS_DIR/nuget.exe
|
13
|
+
CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
|
14
|
+
PACKAGES_CONFIG=$TOOLS_DIR/packages.config
|
15
|
+
PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum
|
16
|
+
|
17
|
+
# Define md5sum or md5 depending on Linux/OSX
|
18
|
+
MD5_EXE=
|
19
|
+
if [[ "$(uname -s)" == "Darwin" ]]; then
|
20
|
+
MD5_EXE="md5 -r"
|
21
|
+
else
|
22
|
+
MD5_EXE="md5sum"
|
23
|
+
fi
|
24
|
+
|
25
|
+
# Define default arguments.
|
26
|
+
SCRIPT="build.cake"
|
27
|
+
TARGET="Default"
|
28
|
+
CONFIGURATION="Release"
|
29
|
+
VERBOSITY="verbose"
|
30
|
+
DRYRUN=
|
31
|
+
SHOW_VERSION=false
|
32
|
+
SCRIPT_ARGUMENTS=()
|
33
|
+
|
34
|
+
# Parse arguments.
|
35
|
+
for i in "$@"; do
|
36
|
+
case $1 in
|
37
|
+
-s|--script) SCRIPT="$2"; shift ;;
|
38
|
+
-t|--target) TARGET="$2"; shift ;;
|
39
|
+
-c|--configuration) CONFIGURATION="$2"; shift ;;
|
40
|
+
-v|--verbosity) VERBOSITY="$2"; shift ;;
|
41
|
+
-d|--dryrun) DRYRUN="-dryrun" ;;
|
42
|
+
--version) SHOW_VERSION=true ;;
|
43
|
+
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;;
|
44
|
+
*) SCRIPT_ARGUMENTS+=("$1") ;;
|
45
|
+
esac
|
46
|
+
shift
|
47
|
+
done
|
48
|
+
|
49
|
+
# Make sure the tools folder exist.
|
50
|
+
if [ ! -d "$TOOLS_DIR" ]; then
|
51
|
+
mkdir "$TOOLS_DIR"
|
52
|
+
fi
|
53
|
+
|
54
|
+
# Make sure that packages.config exist.
|
55
|
+
if [ ! -f "$TOOLS_DIR/packages.config" ]; then
|
56
|
+
echo "Downloading packages.config..."
|
57
|
+
curl -Lsfo "$TOOLS_DIR/packages.config" http://cakebuild.net/download/bootstrapper/packages
|
58
|
+
if [ $? -ne 0 ]; then
|
59
|
+
echo "An error occured while downloading packages.config."
|
60
|
+
exit 1
|
61
|
+
fi
|
62
|
+
fi
|
63
|
+
|
64
|
+
# Download NuGet if it does not exist.
|
65
|
+
if [ ! -f "$NUGET_EXE" ]; then
|
66
|
+
echo "Downloading NuGet..."
|
67
|
+
curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
|
68
|
+
if [ $? -ne 0 ]; then
|
69
|
+
echo "An error occured while downloading nuget.exe."
|
70
|
+
exit 1
|
71
|
+
fi
|
72
|
+
fi
|
73
|
+
|
74
|
+
# Restore tools from NuGet.
|
75
|
+
pushd "$TOOLS_DIR" >/dev/null
|
76
|
+
if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then
|
77
|
+
find . -type d ! -name . | xargs rm -rf
|
78
|
+
fi
|
79
|
+
|
80
|
+
mono "$NUGET_EXE" install -ExcludeVersion
|
81
|
+
if [ $? -ne 0 ]; then
|
82
|
+
echo "Could not restore NuGet packages."
|
83
|
+
exit 1
|
84
|
+
fi
|
85
|
+
|
86
|
+
$MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5"
|
87
|
+
|
88
|
+
popd >/dev/null
|
89
|
+
|
90
|
+
# Make sure that Cake has been installed.
|
91
|
+
if [ ! -f "$CAKE_EXE" ]; then
|
92
|
+
echo "Could not find Cake.exe at '$CAKE_EXE'."
|
93
|
+
exit 1
|
94
|
+
fi
|
95
|
+
|
96
|
+
# Start Cake
|
97
|
+
if $SHOW_VERSION; then
|
98
|
+
exec mono "$CAKE_EXE" -version
|
19
99
|
else
|
20
|
-
|
21
|
-
mono .paket/paket.bootstrapper.exe
|
22
|
-
exit_code=$?
|
23
|
-
if [ $exit_code -ne 0 ]; then
|
24
|
-
exit $exit_code
|
25
|
-
fi
|
26
|
-
|
27
|
-
mono .paket/paket.exe restore
|
28
|
-
exit_code=$?
|
29
|
-
if [ $exit_code -ne 0 ]; then
|
30
|
-
exit $exit_code
|
31
|
-
fi
|
32
|
-
mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
|
100
|
+
exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
|
33
101
|
fi
|
data/tracks/csharp/circle.yml
CHANGED
@@ -5,22 +5,13 @@ machine:
|
|
5
5
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
6
6
|
dependencies:
|
7
7
|
pre:
|
8
|
-
- sudo
|
8
|
+
- sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
|
9
|
+
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
|
9
10
|
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
|
10
11
|
- echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
|
11
12
|
- sudo apt-get update
|
12
13
|
- sudo apt-get install mono-complete
|
13
|
-
- sudo apt-get install
|
14
|
-
- sudo apt-get install libcurl4-openssl-dev
|
15
|
-
- sudo apt-get install libicu-dev
|
16
|
-
- sudo apt-get install libssl-dev
|
17
|
-
- sudo apt-get install libunwind8
|
18
|
-
- sudo apt-get install zlib1g
|
19
|
-
- sudo apt-get install libstdc++6
|
20
|
-
- curl https://download.microsoft.com/download/B/4/6/B4678511-01F4-4F97-902B-0E58A985932A/dotnet-dev-debian-x64.1.0.0-rc4-004771.tar.gz -o /tmp/dotnet.tar.gz
|
21
|
-
- sudo mkdir -p /opt/dotnet
|
22
|
-
- sudo tar zxf /tmp/dotnet.tar.gz -C /opt/dotnet
|
23
|
-
- sudo ln -s /opt/dotnet/dotnet /usr/local/bin
|
14
|
+
- sudo apt-get install dotnet-dev-1.0.1
|
24
15
|
test:
|
25
16
|
override:
|
26
17
|
- ./build.sh
|