Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a43f70

Browse files
committed
Merge from template.
2 parents 3bee244 + 9067131 commit 7a43f70

File tree

6 files changed

+37
-44
lines changed

6 files changed

+37
-44
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to FacilityJavaScript
1+
# Contributing
22

33
## Prerequisites
44

@@ -13,6 +13,4 @@
1313

1414
## How to Build
1515

16-
* Clone the repository: `git clone https://github.com/FacilityApi/FacilityJavaScript.git`
17-
* `cd FacilityJavaScript`
18-
* `.\build.ps1 --target=Test` or `./build.sh --target=Test`
16+
Clone the repository and run `.\build.ps1` or `./build.sh`
File renamed without changes.

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@
44
[![AppVeyor](https://img.shields.io/appveyor/ci/ejball/facilityjavascript.svg)](https://ci.appveyor.com/project/ejball/facilityjavascript)
55
[![Travis CI](https://travis-ci.org/FacilityApi/FacilityJavaScript.svg?branch=master)](https://travis-ci.org/FacilityApi/FacilityJavaScript)
66

7-
## facility-core
8-
9-
Common code for the Facility API Framework. [![npm](https://img.shields.io/npm/v/facility-core.svg)](https://www.npmjs.com/package/facility-core)
10-
11-
## fsdgenjs
12-
13-
A tool that generates JavaScript or TypeScript for a Facility Service Definition. [![NuGet](https://img.shields.io/nuget/v/fsdgenjs.svg)](https://www.nuget.org/packages/fsdgenjs)
14-
15-
## Facility.CodeGen.JavaScript
16-
17-
Used by fsdgenjs to generate JavaScript or TypeScript for a Facility Service Definition. [![NuGet](https://img.shields.io/nuget/v/Facility.CodeGen.JavaScript.svg)](https://www.nuget.org/packages/Facility.CodeGen.JavaScript)
7+
Name | Description | npm/NuGet
8+
--- | --- | ---
9+
facility-core | Common code for the Facility API Framework. | [![npm](https://img.shields.io/npm/v/facility-core.svg)](https://www.npmjs.com/package/facility-core)
10+
fsdgenjs | A tool that generates JavaScript or TypeScript for a Facility Service Definition. | [![NuGet](https://img.shields.io/nuget/v/fsdgenjs.svg)](https://www.nuget.org/packages/fsdgenjs)
11+
Facility.CodeGen.JavaScript | Used by fsdgenjs to generate JavaScript or TypeScript for a Facility Service Definition. | [![NuGet](https://img.shields.io/nuget/v/Facility.CodeGen.JavaScript.svg)](https://www.nuget.org/packages/Facility.CodeGen.JavaScript)
1812

1913
## Documentation
2014

VersionHistory.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
## Pending
44

5-
Add changes here when they're committed to the `master` branch. Move them to "Released" once the version number
6-
is updated in preparation for publishing an updated NuGet package.
5+
Add changes here when they're committed to the `master` branch. To publish, update the version number in [Directory.Build.props](Directory.Build.props), move the pending changes below to a new [Released](#released) section, and [create a new release](https://github.com/FacilityApi/Facility/releases) using the version number, e.g. `v2.3.4`.
76

8-
Prefix the description of the change with `[major]`, `[minor]` or `[patch]` in accordance with [SemVer](http://semver.org).
7+
Prefix the description of each change with `[major]`, `[minor]`, or `[patch]` in accordance with [SemVer](http://semver.org).
98

109
* [major] Upgrade to .NET Standard 2.0 and .NET 4.6.1. Upgrade NuGet dependencies.
1110

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ image:
33
- Visual Studio 2017
44
- Ubuntu
55
environment:
6-
NUGETAPIKEY:
6+
NUGET_API_KEY:
77
secure: QEn16fxymoBroWnkHAsN94ARrAA8tX/L48Ue90x3zfxN0YMgwczJEVtTs/71HR5A
88
BUILD_BOT_PASSWORD:
9-
secure: U2EQbBdxNIC2FL8YeOP3bVixlZ4xLBdN71Szraw+ATqAhYZwEd6JCjCJZLJPu9kN
9+
secure: nRnlm4SD3Htof+YIoW7URXirI8vKtVrZX24Cou4mtfjwvj1OZkotbS5jogxhf06x
1010
APPVEYOR_YML_DISABLE_PS_LINUX: true
1111
build_script:
12-
- ps: .\build.ps1 --target=NuGetPublish """--trigger=$env:APPVEYOR_REPO_TAG_NAME""" "--nugetApiKey=$env:NUGETAPIKEY"
13-
- sh: ./build.sh --target=NuGetPackage "--trigger=$APPVEYOR_REPO_TAG_NAME"
12+
- ps: .\build.ps1 --target=Publish
13+
- sh: ./build.sh --target=Package
1414
test: off

build.cake

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,29 @@ using System.Text.RegularExpressions;
55

66
var target = Argument("target", "Default");
77
var configuration = Argument("configuration", "Release");
8-
var nugetApiKey = Argument("nugetApiKey", "");
9-
var trigger = Argument("trigger", "");
108
var versionSuffix = Argument("versionSuffix", "");
119

1210
var solutionFileName = "FacilityJavaScript.sln";
1311
var docsAssemblies = new[] { "Facility.CodeGen.JavaScript" };
1412
var docsAssemblyDirectory = $"src/fsdgenjs/bin/{configuration}";
15-
var docsRepoUri = "https://github.com/FacilityApi/FacilityApi.github.io.git";
16-
var docsRepoBranch = "master";
1713
var docsSourceUri = "https://github.com/FacilityApi/FacilityJavaScript/tree/master/src";
14+
var codeGenExe = $"src/fsdgenjs/bin/{configuration}/fsdgenjs.exe";
1815

1916
var nugetSource = "https://api.nuget.org/v3/index.json";
20-
var buildBotUserName = "ejball";
17+
var nugetApiKey = EnvironmentVariable("NUGET_API_KEY");
18+
var docsRepoUri = "https://github.com/FacilityApi/FacilityApi.github.io.git";
19+
var docsRepoBranch = "master";
20+
var buildBotUserName = "FacilityApiBot";
21+
var buildBotEmail = "[email protected]";
2122
var buildBotPassword = EnvironmentVariable("BUILD_BOT_PASSWORD");
23+
var trigger = EnvironmentVariable("APPVEYOR_REPO_TAG_NAME");;
24+
var buildBranch = EnvironmentVariable("APPVEYOR_REPO_BRANCH");
25+
26+
void CodeGen(bool verify)
27+
{
28+
ExecuteCodeGen("example/ExampleApi.fsd example/js/ --indent 2 --express", verify);
29+
ExecuteCodeGen("example/ExampleApi.fsd example/ts/src/ --typescript --express", verify);
30+
}
2231

2332
Task("Clean")
2433
.Does(() =>
@@ -57,7 +66,7 @@ Task("Test")
5766
DotNetCoreTest(projectPath, new DotNetCoreTestSettings { Configuration = configuration });
5867
});
5968

60-
Task("NuGetPackage")
69+
Task("Package")
6170
.IsDependentOn("Rebuild")
6271
.IsDependentOn("Test")
6372
.Does(() =>
@@ -79,15 +88,14 @@ Task("UpdateDocs")
7988
GitClone(docsRepoUri, docsDirectory, new GitCloneSettings { BranchName = docsRepoBranch });
8089

8190
var outputPath = $"release/{docsRepoBranch}/reference";
82-
var buildBranch = EnvironmentVariable("APPVEYOR_REPO_BRANCH");
83-
var isPreview = buildBranch != "master" || !Regex.IsMatch(trigger, @"^(nuget-v[0-9]+\.[0-9]+\.[0-9]+|update-docs)$");
91+
var isPreview = buildBranch != "master" || trigger == null || !Regex.IsMatch(trigger, @"^(nuget-v[0-9]+\.[0-9]+\.[0-9]+|update-docs)$");
8492
if (isPreview)
8593
outputPath += $"/preview/{buildBranch}";
8694

8795
Information($"Updating documentation at {outputPath}.");
8896
foreach (var docsAssembly in docsAssemblies)
8997
{
90-
XmlDocMarkdownGenerate(File($"{docsAssemblyDirectory}/{docsAssembly}.dll").ToString(), $"{outputPath}/",
98+
XmlDocMarkdownGenerate($"{docsAssemblyDirectory}/{docsAssembly}.dll", $"{outputPath}/",
9199
new XmlDocMarkdownSettings { SourceCodePath = $"{docsSourceUri}/{docsAssembly}", NewLine = "\n", ShouldClean = true });
92100
}
93101

@@ -99,7 +107,7 @@ Task("UpdateDocs")
99107
{
100108
Information("Committing all documentation changes.");
101109
GitAddAll(docsDirectory);
102-
GitCommit(docsDirectory, "Ed Ball", "[email protected]",
110+
GitCommit(docsDirectory, buildBotUserName, buildBotEmail,
103111
"Automatic documentation update." + (isPreview ? $" (preview {buildBranch})" : ""));
104112
Information("Pushing updated documentation to GitHub.");
105113
GitPush(docsDirectory, buildBotUserName, buildBotPassword, docsRepoBranch);
@@ -110,8 +118,8 @@ Task("UpdateDocs")
110118
}
111119
});
112120

113-
Task("NuGetPublish")
114-
.IsDependentOn("NuGetPackage")
121+
Task("Publish")
122+
.IsDependentOn("Package")
115123
.IsDependentOn("UpdateDocs")
116124
.Does(() =>
117125
{
@@ -127,9 +135,9 @@ Task("NuGetPublish")
127135
throw new InvalidOperationException($"Mismatched package versions '{version}' and '{nupkgVersion}'.");
128136
}
129137

130-
if (!string.IsNullOrEmpty(nugetApiKey) && (trigger == null || Regex.IsMatch(trigger, "^nuget-v[0-9]")))
138+
if (!string.IsNullOrEmpty(nugetApiKey) && trigger != null && Regex.IsMatch(trigger, "^nuget-v[0-9]"))
131139
{
132-
if (trigger != null && trigger != $"nuget-v{version}")
140+
if (trigger != $"nuget-v{version}")
133141
throw new InvalidOperationException($"Trigger '{trigger}' doesn't match package version '{version}'.");
134142

135143
var pushSettings = new NuGetPushSettings { ApiKey = nugetApiKey, Source = nugetSource };
@@ -145,16 +153,10 @@ Task("NuGetPublish")
145153
Task("Default")
146154
.IsDependentOn("Test");
147155

148-
void CodeGen(bool verify)
149-
{
150-
var fsdPath = File("example/ExampleApi.fsd").ToString();
151-
ExecuteCodeGen($"{fsdPath} {File("example/js")}/ --indent 2 --express", verify);
152-
ExecuteCodeGen($"{fsdPath} {File("example/ts/src")}/ --typescript --express", verify);
153-
}
154-
155156
void ExecuteCodeGen(string args, bool verify)
156157
{
157-
string exePath = File($"src/fsdgenjs/bin/{configuration}/fsdgenjs.exe");
158+
Information(args);
159+
string exePath = codeGenExe;
158160
if (IsRunningOnUnix())
159161
{
160162
args = exePath + " " + args;

0 commit comments

Comments
 (0)