Skip to content

Commit a1912a2

Browse files
authored
feature: Initial version (#1)
* Initial version * Initial version
1 parent 426d97d commit a1912a2

File tree

241 files changed

+11658
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+11658
-0
lines changed

.editorconfig

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/ci-build.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
types: [opened, synchronize, reopened, closed]
8+
branches: [ main ]
9+
10+
env:
11+
configuration: Release
12+
productNamespacePrefix: "Splat"
13+
14+
jobs:
15+
build:
16+
runs-on: windows-latest
17+
outputs:
18+
nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install .NET Core
26+
uses: actions/[email protected]
27+
with:
28+
dotnet-version: 3.1.x
29+
30+
- name: Install .NET 5
31+
uses: actions/[email protected]
32+
with:
33+
dotnet-version: 5.0.x
34+
35+
# - name: Update VS2019
36+
# shell: powershell
37+
# run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"""
38+
39+
- name: NBGV
40+
id: nbgv
41+
uses: dotnet/nbgv@master
42+
with:
43+
setAllVars: true
44+
45+
- name: NuGet Restore
46+
run: dotnet restore
47+
working-directory: src
48+
49+
- name: Build
50+
run: dotnet build --configuration=${{ env.configuration }} --verbosity=minimal --no-restore
51+
working-directory: src
52+
53+
- name: Run Unit Tests and Generate Coverage
54+
uses: glennawatson/coverlet-msbuild@v1
55+
with:
56+
project-files: '**/*Tests*.csproj'
57+
no-build: true
58+
exclude-filter: '[${{env.productNamespacePrefix}}.*.Tests.*]*'
59+
include-filter: '[${{env.productNamespacePrefix}}*]*'
60+
output-format: cobertura
61+
output: '../../artifacts/'
62+
configuration: ${{ env.configuration }}
63+
64+
- name: Pack
65+
run: dotnet pack --configuration=${{ env.configuration }} --verbosity=minimal --no-restore
66+
working-directory: src
67+
68+
- name: Upload Code Coverage
69+
shell: bash
70+
run: |
71+
echo $PWD
72+
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -t ${{ env.CODECOV_TOKEN }} -s '$PWD/artifacts' -f '*.xml'
73+
env:
74+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
75+
76+
- name: Create NuGet Artifacts
77+
uses: actions/upload-artifact@master
78+
with:
79+
name: nuget
80+
path: '**/*.nupkg'
81+
82+
release:
83+
runs-on: windows-latest
84+
needs: build
85+
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
86+
steps:
87+
- name: Checkout
88+
uses: actions/[email protected]
89+
with:
90+
fetch-depth: 0
91+
92+
- name: Download NuGet Packages
93+
uses: actions/[email protected]
94+
with:
95+
name: nuget
96+
97+
- uses: nuget/setup-nuget@v1
98+
name: Setup NuGet
99+
100+
# Decode the base 64 encoded pfx and save the Signing_Certificate
101+
- name: Sign NuGet packages
102+
shell: pwsh
103+
run: |
104+
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}")
105+
[IO.File]::WriteAllBytes("GitHubActionsWorkflow.pfx", $pfx_cert_byte)
106+
$secure_password = ConvertTo-SecureString ${{ secrets.SIGN_CERTIFICATE_PASSWORD }} –asplaintext –force
107+
Import-PfxCertificate -FilePath GitHubActionsWorkflow.pfx -Password $secure_password -CertStoreLocation Cert:\CurrentUser\My
108+
nuget sign -Timestamper http://timestamp.digicert.com -CertificateFingerprint ${{ secrets.SIGN_CERTIFICATE_HASH }} **/*.nupkg
109+
110+
- name: Changelog
111+
uses: glennawatson/ChangeLog@v1
112+
id: changelog
113+
114+
- name: Create Release
115+
uses: actions/[email protected]
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
118+
with:
119+
tag_name: ${{ needs.build.outputs.nbgv }}
120+
release_name: ${{ needs.build.outputs.nbgv }}
121+
body: |
122+
${{ steps.changelog.outputs.commitLog }}
123+
124+
- name: NuGet Push
125+
env:
126+
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
127+
SOURCE_URL: https://api.nuget.org/v3/index.json
128+
run: |
129+
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg

src/.idea/.idea.Splat.DI.SourceGenerator/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Splat.DI.SourceGenerator/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Splat.DI.SourceGenerator/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Splat.DI.SourceGenerator/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Splat.DI.SourceGenerator/.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Splat.DI.SourceGenerator/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Directory.Build.props

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<Project>
2+
<PropertyGroup>
3+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
4+
<Platform>AnyCPU</Platform>
5+
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
6+
<DebugType>embedded</DebugType>
7+
<Authors>Glenn Watson</Authors>
8+
<Copyright>Copyright (c) 2021 ReactiveUI Association Inc</Copyright>
9+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
10+
<PackageProjectUrl>https://github.com/reactivemarbles/ObservableEvents</PackageProjectUrl>
11+
<PackageDescription>Generates source for Splat dependency injection registrations with constructor and property injection.</PackageDescription>
12+
<Owners>glennawatson</Owners>
13+
<PackageTags>system.reactive;splat;dependency injection</PackageTags>
14+
<PackageReleaseNotes>https://github.com/reactivemarbles/Splat.DI.SourceGenerator/releases</PackageReleaseNotes>
15+
<RepositoryUrl>https://github.com/reactivemarbles/Splat.DI.SourceGenerator</RepositoryUrl>
16+
<PackageIconUrl>https://github.com/reactiveui/styleguide/blob/master/logo_splat/logo.png?raw=true</PackageIconUrl>
17+
<RepositoryType>git</RepositoryType>
18+
19+
<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
20+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
21+
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
22+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
23+
<!-- Include PDB in the built .nupkg -->
24+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
25+
</PropertyGroup>
26+
27+
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
28+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
29+
</ItemGroup>
30+
31+
<PropertyGroup>
32+
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
33+
</PropertyGroup>
34+
35+
<ItemGroup>
36+
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
37+
</ItemGroup>
38+
39+
<ItemGroup>
40+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.220" PrivateAssets="all" />
41+
</ItemGroup>
42+
43+
<ItemGroup>
44+
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.354" PrivateAssets="all" />
45+
<PackageReference Include="Roslynator.Analyzers" Version="3.2.0" PrivateAssets="All" />
46+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
50+
</ItemGroup>
51+
</Project>

src/Directory.build.targets

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Product>$(AssemblyName) ($(TargetFramework))</Product>
4+
</PropertyGroup>
5+
6+
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
7+
<DefineConstants>$(DefineConstants);NET_45;XAML</DefineConstants>
8+
</PropertyGroup>
9+
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap'))">
10+
<DefineConstants>$(DefineConstants);NETFX_CORE;XAML;WINDOWS_UWP</DefineConstants>
11+
</PropertyGroup>
12+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS'))">
13+
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
14+
</PropertyGroup>
15+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac'))">
16+
<DefineConstants>$(DefineConstants);MONO;COCOA</DefineConstants>
17+
</PropertyGroup>
18+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.TVOS'))">
19+
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
20+
</PropertyGroup>
21+
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.WatchOS'))">
22+
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
23+
</PropertyGroup>
24+
<PropertyGroup Condition="$(TargetFramework.StartsWith('MonoAndroid'))">
25+
<DefineConstants>$(DefineConstants);MONO;ANDROID</DefineConstants>
26+
</PropertyGroup>
27+
<PropertyGroup Condition="$(TargetFramework.StartsWith('tizen'))">
28+
<DefineConstants>$(DefineConstants);TIZEN</DefineConstants>
29+
</PropertyGroup>
30+
</Project>

0 commit comments

Comments
 (0)