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

Skip to content

Commit aadb3be

Browse files
committed
Merge template/faithlife-build.
2 parents b4ac765 + f6f2751 commit aadb3be

File tree

12 files changed

+73
-96
lines changed

12 files changed

+73
-96
lines changed

.editorconfig

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,60 @@ root = true
22

33
[*]
44
charset = utf-8
5-
indent_style = space
5+
end_of_line = lf
66
indent_size = 2
7-
trim_trailing_whitespace = true
7+
indent_style = space
88
insert_final_newline = true
9-
end_of_line = lf
9+
trim_trailing_whitespace = true
1010

11-
[*.{fsd,md,ts}]
12-
indent_style = tab
11+
[*.fsd]
1312
indent_size = 4
13+
indent_style = tab
1414

15-
[*.sh]
15+
[*.ts]
1616
indent_size = 4
17-
18-
[*.sln]
19-
end_of_line = crlf
20-
21-
[*.csproj]
22-
insert_final_newline = false
17+
indent_style = tab
2318

2419
[*.cs]
25-
indent_style = tab
2620
indent_size = 4
21+
indent_style = tab
2722

28-
# changes from VS2017 defaults
29-
csharp_style_expression_bodied_methods = true : suggestion
30-
csharp_style_expression_bodied_constructors = true : suggestion
31-
csharp_style_expression_bodied_operators = true : suggestion
32-
csharp_prefer_braces = false : none
23+
# changes from defaults
24+
csharp_style_expression_bodied_methods = true:hint
25+
csharp_style_expression_bodied_constructors = true:hint
26+
csharp_style_expression_bodied_operators = true:hint
27+
csharp_prefer_braces = false:none
3328
csharp_indent_switch_labels = false
3429
csharp_space_after_cast = true
3530
csharp_preserve_single_line_statements = false
3631

37-
# use VS2017 defaults, but make them warnings (instead of none)
38-
dotnet_style_qualification_for_field = false : warning
39-
dotnet_style_qualification_for_property = false : warning
40-
dotnet_style_qualification_for_method = false : warning
41-
dotnet_style_qualification_for_event = false : warning
42-
dotnet_style_predefined_type_for_locals_parameters_members = true : warning
43-
dotnet_style_explicit_tuple_names = true : warning
44-
dotnet_style_coalesce_expression = true : warning
32+
# use defaults, but make them warnings (instead of none)
33+
dotnet_style_qualification_for_field = false:warning
34+
dotnet_style_qualification_for_property = false:warning
35+
dotnet_style_qualification_for_method = false:warning
36+
dotnet_style_qualification_for_event = false:warning
37+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
38+
dotnet_style_explicit_tuple_names = true:warning
39+
dotnet_style_coalesce_expression = true:warning
4540

46-
# use VS2017 defaults, but make them suggestions (instead of none)
47-
csharp_style_var_for_built_in_types = true : suggestion
48-
csharp_style_var_when_type_is_apparent = true : suggestion
49-
csharp_style_var_elsewhere = true : suggestion
50-
csharp_style_expression_bodied_properties = true : suggestion
51-
csharp_style_expression_bodied_indexers = true : suggestion
52-
csharp_style_expression_bodied_accessors = true : suggestion
41+
# use defaults, but make them suggestions (instead of none)
42+
csharp_style_var_for_built_in_types = true:suggestion
43+
csharp_style_var_when_type_is_apparent = true:suggestion
44+
csharp_style_var_elsewhere = true:suggestion
45+
csharp_style_expression_bodied_properties = true:suggestion
46+
csharp_style_expression_bodied_indexers = true:suggestion
47+
csharp_style_expression_bodied_accessors = true:suggestion
5348

54-
# explicitly use VS2017 defaults
55-
dotnet_style_object_initializer = true : suggestion
56-
dotnet_style_collection_initializer = true : suggestion
57-
dotnet_style_null_propagation = true : suggestion
58-
csharp_style_pattern_matching_over_is_with_cast_check = true : suggestion
59-
csharp_style_pattern_matching_over_as_with_null_check = true : suggestion
60-
csharp_style_inlined_variable_declaration = true : suggestion
61-
csharp_prefer_simple_default_expression = true : suggestion
62-
csharp_style_throw_expression = true : suggestion
63-
csharp_style_conditional_delegate_call = true : suggestion
49+
# explicitly use defaults
50+
dotnet_style_object_initializer = true:suggestion
51+
dotnet_style_collection_initializer = true:suggestion
52+
dotnet_style_null_propagation = true:suggestion
53+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
54+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
55+
csharp_style_inlined_variable_declaration = true:suggestion
56+
csharp_prefer_simple_default_expression = true:suggestion
57+
csharp_style_throw_expression = true:suggestion
58+
csharp_style_conditional_delegate_call = true:suggestion
6459
dotnet_sort_system_directives_first = true
6560
csharp_new_line_before_open_brace = all
6661
csharp_new_line_before_else = true

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
*.cs text diff=csharp
44
*.csproj text merge=union
5-
*.sln text eol=crlf merge=union
5+
*.sln text merge=union

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Prerequisites
44

5-
* Install [Visual Studio 2017](https://visualstudio.microsoft.com/downloads/) or [Visual Studio Code](https://code.visualstudio.com/) with the [editorconfig extension](https://github.com/editorconfig/editorconfig-vscode).
6-
* Install [.NET Core 2.x](https://dotnet.microsoft.com/download).
5+
* Install [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) or [Visual Studio Code](https://code.visualstudio.com/).
6+
* Install [.NET Core 3.x](https://dotnet.microsoft.com/download).
77

88
## Guidelines
99

10-
* All new code **must** have complete unit tests.
11-
* All public classes, methods, interfaces, enums, etc. **must** have correct XML documentation comments.
10+
* All new code should have complete unit tests.
11+
* All public classes, methods, interfaces, enums, etc. should have correct XML documentation comments.
1212
* Update [VersionHistory](VersionHistory.md) with a human-readable description of the change.
1313

1414
## How to Build

Directory.Build.props

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<PropertyGroup>
44
<VersionPrefix>2.0.0</VersionPrefix>
55
<LangVersion>latest</LangVersion>
6+
<Nullable>enable</Nullable>
67
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
78
<NeutralLanguage>en-US</NeutralLanguage>
89
<NoWarn>$(NoWarn);1591</NoWarn>
9-
<DebugType>portable</DebugType>
10-
<DebugSymbols>True</DebugSymbols>
10+
<DebugType>embedded</DebugType>
1111
<GitHubOrganization>FacilityApi</GitHubOrganization>
1212
<RepositoryName>FacilityJavaScript</RepositoryName>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -18,7 +18,6 @@
1818
<Copyright>Copyright $(Authors)</Copyright>
1919
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2020
<EmbedUntrackedSources>true</EmbedUntrackedSources>
21-
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
2221
<IsPackable>false</IsPackable>
2322
<IsTestProject>false</IsTestProject>
2423
</PropertyGroup>
@@ -28,8 +27,8 @@
2827
</PropertyGroup>
2928

3029
<ItemGroup>
31-
<PackageReference Include="Faithlife.Analyzers" Version="1.0.5" PrivateAssets="All" />
32-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" PrivateAssets="All" />
30+
<PackageReference Include="Faithlife.Analyzers" Version="1.0.7" PrivateAssets="All" />
31+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
3332
</ItemGroup>
3433

3534
</Project>

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright 2019 Ed Ball
3+
Copyright 2020 Ed Ball
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

VersionHistory.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
# Version History
22

3-
## Pending
4-
5-
Describe changes here when they're committed to the `master` branch. To publish, update the version number in [Directory.Build.props](src/Directory.Build.props), move the pending changes below to a new [Released](#released) section, and push a git tag using the version number, e.g. `v2.3.4`.
6-
7-
Prefix the description of the change with `[major]`, `[minor]`, or `[patch]` in accordance with [Semantic Versioning](https://semver.org/).
8-
9-
## Released
10-
113
### 2.0.0
124

13-
* [major] Upgrade to .NET Standard 2.0 and .NET 4.6.1. Upgrade NuGet dependencies.
14-
* [minor] Support disabling ESLint.
5+
* Upgrade to .NET Standard 2.0 and .NET 4.6.1. Upgrade NuGet dependencies.
6+
* Support disabling ESLint.
157

168
### 1.3.0
179

appveyor.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
version: '{build}'
22
image:
3-
- Visual Studio 2017
3+
- Visual Studio 2019
44
- Ubuntu
55
environment:
66
NUGET_API_KEY:
7-
secure: ui2NHCkD1RaeInP9garBAG67yxHp78AykDTSKGZcWX25GehDjWz/K8w24QkHItgz
7+
secure: rFsvWqQyNMq89Bm2UUBbv1hw7EqmUtphBMKqfwfDHtwIKnknms5vcIay4XYFEXea
88
BUILD_BOT_PASSWORD:
99
secure: nRnlm4SD3Htof+YIoW7URXirI8vKtVrZX24Cou4mtfjwvj1OZkotbS5jogxhf06x
1010
build_script:
11-
- cmd: .\build.cmd publish "--trigger=%APPVEYOR_REPO_TAG_NAME%" "--build-number=%APPVEYOR_BUILD_NUMBER%"
11+
- cmd: if %APPVEYOR_REPO_BRANCH% neq master .\build.cmd package
12+
- cmd: if %APPVEYOR_REPO_BRANCH% equ master if defined APPVEYOR_PULL_REQUEST_NUMBER .\build.cmd package
13+
- cmd: if %APPVEYOR_REPO_BRANCH% equ master if not defined APPVEYOR_PULL_REQUEST_NUMBER .\build.cmd publish --trigger=publish-all --build-number=%APPVEYOR_BUILD_NUMBER%
1214
- sh: ./build.sh package
1315
test: off

build.cmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
@dotnet run --project %~dp0\tools\Build\Build.csproj -- %*
1+
@echo off
2+
pushd %~dp0
3+
dotnet publish tools\Build\Build.csproj --output tools\bin\Build --nologo --verbosity quiet
4+
if %errorlevel% equ 0 dotnet tools\bin\Build\Build.dll %*
5+
popd
6+
exit /b %errorlevel%

build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
3-
export MONO_ROOT=$(dirname $(which mono))/../
4-
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5-
dotnet run --project "$SCRIPT_DIR/tools/Build/Build.csproj" -- "$@"
3+
cd "$( dirname "${BASH_SOURCE[0]}" )"
4+
dotnet publish ./tools/Build/Build.csproj --output ./tools/bin/Build --nologo --verbosity quiet
5+
dotnet ./tools/bin/Build/Build.dll "$@"

tools/Build/Build.cs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using System;
2-
using System.IO;
32
using System.Linq;
4-
using System.Text.RegularExpressions;
53
using Faithlife.Build;
6-
using static Faithlife.Build.AppRunner;
74
using static Faithlife.Build.BuildUtility;
85
using static Faithlife.Build.DotNetRunner;
96

@@ -13,8 +10,6 @@ public static int Main(string[] args) => BuildRunner.Execute(args, build =>
1310
{
1411
var codegen = "fsdgenjs";
1512

16-
var dotNetTools = new DotNetTools(Path.Combine("tools", "bin")).AddSource(Path.Combine("tools", "bin"));
17-
1813
var dotNetBuildSettings = new DotNetBuildSettings
1914
{
2015
NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"),
@@ -26,11 +21,6 @@ public static int Main(string[] args) => BuildRunner.Execute(args, build =>
2621
SourceCodeUrl = "https://github.com/FacilityApi/FacilityJavaScript/tree/master/src",
2722
ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal),
2823
},
29-
DotNetTools = dotNetTools,
30-
SourceLinkSettings = new SourceLinkSettings
31-
{
32-
ShouldTestPackage = name => !name.StartsWith("fsdgen", StringComparison.Ordinal),
33-
},
3424
};
3525

3626
build.AddDotNetTargets(dotNetBuildSettings);
@@ -50,19 +40,13 @@ public static int Main(string[] args) => BuildRunner.Execute(args, build =>
5040

5141
void codeGen(bool verify)
5242
{
53-
string configuration = dotNetBuildSettings.BuildOptions.ConfigurationOption.Value;
54-
string versionSuffix = $"cg{DateTime.UtcNow:yyyyMMddHHmmss}";
55-
RunDotNet("pack", Path.Combine("src", codegen, $"{codegen}.csproj"), "-c", configuration, "--no-build",
56-
"--output", Path.GetFullPath(Path.Combine("tools", "bin")), "--version-suffix", versionSuffix);
57-
58-
string packagePath = FindFiles($"tools/bin/{codegen}.*-{versionSuffix}.nupkg").Single();
59-
string packageVersion = Regex.Match(packagePath, @"[/\\][^/\\]*\.([0-9]+\.[0-9]+\.[0-9]+(-.+)?)\.nupkg$").Groups[1].Value;
60-
string toolPath = dotNetTools.GetToolPath($"{codegen}/{packageVersion}");
43+
var configuration = dotNetBuildSettings!.BuildOptions!.ConfigurationOption!.Value;
44+
var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/netcoreapp*/{codegen}.dll").FirstOrDefault();
6145

62-
string verifyOption = verify ? "--verify" : null;
46+
var verifyOption = verify ? "--verify" : null;
6347

64-
RunApp(toolPath, "example/ExampleApi.fsd", "example/js/", "--indent", "2", "--express", "--disable-eslint", "--newline", "lf", verifyOption);
65-
RunApp(toolPath, "example/ExampleApi.fsd", "example/ts/src/", "--typescript", "--express", "--disable-eslint", "--newline", "lf", verifyOption);
48+
RunDotNet(toolPath, "example/ExampleApi.fsd", "example/js/", "--indent", "2", "--express", "--disable-eslint", "--newline", "lf", verifyOption);
49+
RunDotNet(toolPath, "example/ExampleApi.fsd", "example/ts/src/", "--typescript", "--express", "--disable-eslint", "--newline", "lf", verifyOption);
6650
}
6751
});
6852
}

0 commit comments

Comments
 (0)