Skip to content

Commit 7ace036

Browse files
Updated cake build and added travis.yml
1 parent 161da26 commit 7ace036

File tree

7 files changed

+129
-111
lines changed

7 files changed

+129
-111
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[*]
2-
end_of_line = crlf
32
charset = utf-8
43
indent_style = space
54
indent_size = 4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ buildlog
3434

3535
# Build folder
3636
tools/*/
37-
tools/packages.config.md5sum
37+
/tools/packages.config.md5sum

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: csharp
2+
sudo: required
3+
dist: trusty
4+
mono: beta
5+
dotnet: 2.0.0
6+
os:
7+
- linux
8+
# env:
9+
# global:
10+
# secure: m2PtYwYOhaK0uFMZ19ZxApZwWZeAIq1dS//jx/5I3txpIWD+TfycQMAWYxycFJ/GJkeVF29P4Zz1uyS2XKKjPJpp2Pds98FNQyDv3OftpLAVa0drsjfhurVlBmSdrV7GH6ncKfvhd+h7KVK5vbZc+NeR4dH7eNvN/jraS//AMJg=
11+
12+
script:
13+
- ./build.sh

build.sh

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,101 @@
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" https://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
99-
else
100-
exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
101-
fi
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" https://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
99+
else
100+
exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
101+
fi

cake.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Paths]
2+
Tools=./tools
3+
Addins=./tools
4+
[Nuget]
5+
UseInprocessClient=true
6+
LoadDependencies=true

src/JsonRpc/InputHandler.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ IResponseRouter responseRouter
4444

4545
_scheduler = new ProcessScheduler();
4646
_inputThread = new Thread(ProcessInputStream) { IsBackground = true, Name = "ProcessInputStream" };
47-
}
47+
}
4848

4949
public void Start()
5050
{
@@ -57,7 +57,7 @@ public void Start()
5757
private void ProcessInputStream()
5858
{
5959
// some time to attach a debugger
60-
// System.Threading.Thread.Sleep(TimeSpan.FromSeconds(5));
60+
// System.Threading.Thread.Sleep(TimeSpan.FromSeconds(5));
6161

6262
// header is encoded in ASCII
6363
// "Content-Length: 0" counts bytes for the following content
@@ -69,7 +69,7 @@ private void ProcessInputStream()
6969
var buffer = new byte[300];
7070
var current = _input.Read(buffer, 0, MinBuffer);
7171
if (current == 0) return; // no more _input
72-
while (current < MinBuffer ||
72+
while (current < MinBuffer ||
7373
buffer[current - 4] != CR || buffer[current - 3] != LF ||
7474
buffer[current - 2] != CR || buffer[current - 1] != LF)
7575
{
@@ -108,7 +108,7 @@ private void ProcessInputStream()
108108
received += n;
109109
}
110110
// TODO sometimes: encoding should be based on the respective header (including the wrong "utf8" value)
111-
var payload = System.Text.Encoding.UTF8.GetString(requestBuffer);
111+
var payload = System.Text.Encoding.UTF8.GetString(requestBuffer);
112112
HandleRequest(payload);
113113
}
114114
}
@@ -157,7 +157,7 @@ private void HandleRequest(string request)
157157
return;
158158
}
159159

160-
foreach (var (type, item) in requests.Select(x => (_requestProcessIdentifier.Identify(x), x)))
160+
foreach (var (type, item) in requests.Select(x => (type: _requestProcessIdentifier.Identify(x), item: x)))
161161
{
162162
if (item.IsRequest)
163163
{
@@ -195,4 +195,4 @@ public void Dispose()
195195
_scheduler.Dispose();
196196
}
197197
}
198-
}
198+
}

tasks/variables.cake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Dictionary<string, string> GitVersionEnvironmentVariables { get {
1212
{ "GitVersion_PreReleaseTag", gv.PreReleaseTag },
1313
{ "GitVersion_PreReleaseTagWithDash", gv.PreReleaseTagWithDash },
1414
{ "GitVersion_PreReleaseLabel", gv.PreReleaseLabel },
15-
{ "GitVersion_PreReleaseNumber", gv.PreReleaseNumber },
15+
{ "GitVersion_PreReleaseNumber", gv.PreReleaseNumber.ToString() },
1616
{ "GitVersion_BuildMetaData", gv.BuildMetaData },
1717
{ "GitVersion_BuildMetaDataPadded", gv.BuildMetaDataPadded },
1818
{ "GitVersion_FullBuildMetaData", gv.FullBuildMetaData },
@@ -26,7 +26,7 @@ Dictionary<string, string> GitVersionEnvironmentVariables { get {
2626
{ "GitVersion_BranchName", gv.BranchName },
2727
{ "GitVersion_Sha", gv.Sha },
2828
{ "GitVersion_NuGetVersion", gv.NuGetVersion },
29-
{ "GitVersion_CommitsSinceVersionSource", gv.CommitsSinceVersionSource },
29+
{ "GitVersion_CommitsSinceVersionSource", gv.CommitsSinceVersionSource.ToString() },
3030
{ "GitVersion_CommitsSinceVersionSourcePadded", gv.CommitsSinceVersionSourcePadded },
3131
{ "GitVersion_CommitDate", gv.CommitDate },
3232
};

0 commit comments

Comments
 (0)