Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contribute to ACadSharp.Formats

## Report bugs

- Before creating a new issue, please ensure the bug was not already reported or there is already a similar one
by searching on GitHub under [issues](https://github.com/DomCR/ACadSharp.Formats/issues).
- Otherwise [open an issue](https://github.com/DomCR/ACadSharp.Formats/issues/new?template=bug_report.md) addressing the problem. Please try to follow the template which helps to identify the problem faster.
- If you write a snipped of code, make sure that is [correctly formatted](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks) and specify the language used in it.

## Request a new feature

- Use the following [template](https://github.com/DomCR/ACadSharp.Formats/issues/new?template=feature_request.md) to propose a new feature.

## Create a Pull Request

- If you fixed an issue or have developed a useful feature that you would like to include in the library, feel free to create a pull request, I'll give feedback as soon as I can.

## Building

Before building run:

```console
git submodule update --init --recursive
```

This command will clone the submodules necessary to build the project.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: DomCR
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior or an example of the code used.

**Expected behavior**
A clear and concise description of what you expected to happen if needed.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

---

**Release needed**

- [ ] Yes, using the Nuget package.
- [ ] No, using the github repo.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Description

Short description about this PR

# Tasks done in this PR
* [ ] Something awesome.
* [ ] An evil bug have been defeated.
* [ ] Code cleanup and maintenance has been done.

# Related Issues / Pull Requests
- Add the links of issues or PR related to this one.
# Notes for reviewer
- Things to consider during the review of this PR.
36 changes: 36 additions & 0 deletions .github/workflows/auto-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Auto Version

on:
pull_request:
types: [labeled]

permissions:
contents: write

env:
CURRENT_BRANCH: ${{github.event.pull_request.head.ref}}
VERSION_FORMAT: ${{ fromJSON('[ "*.^.0", "*.*.^"]')[contains(github.event.pull_request.labels.*.name, 'minor')] }}

jobs:
update:
if: contains(github.event.pull_request.labels.*.name, 'minor') || contains(github.event.pull_request.labels.*.name, 'major')
runs-on: windows-latest
name: Update version
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
ref: ${{env.CURRENT_BRANCH}}
- name: Update version
id: update
uses: vers-one/dotnet-project-version-updater@v1.7
with:
file: ./src/ACadSharp.Formats/ACadSharp.Formats.csproj
version: ${{env.VERSION_FORMAT}}
- name: Push changes
run: ./push-changes.sh
shell: bash
env:
VERSION: ${{steps.update.outputs.newVersion}}
BRANCH: ${{env.CURRENT_BRANCH}}
38 changes: 38 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Coveralls

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
coveralls:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cardinalby/export-env-action@v2
with:
envFile: 'github.env'
- name: Setup submodules
run: git submodule update --init --recursive
- name: Build and Test ACadSharp
working-directory: src
run: |
dotnet restore
dotnet build --no-restore
dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=lcov --no-restore --no-build --framework net9.0 --verbosity normal ACadSharp.Formats.Tests/
- name: Build and Test Submodules
working-directory: src/ACadSharp/src/CSUtilities
run: |
dotnet restore
dotnet build --no-restore
dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=lcov --no-restore --no-build --framework net9.0 --verbosity normal CSUtilities.Tests/
dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=lcov --no-restore --no-build --framework net9.0 --verbosity normal CSMath.Tests/
- name: Coveralls action
uses: coverallsapp/github-action@v2
with:
github-token: ${{ github.token }}
files: src/ACadSharp.Formats.Tests/TestResults/coverage.net9.0.info src/ACadSharp.Formats.Tests/src/CSUtilities/CSUtilities.Tests/TestResults/coverage.net9.0.info src/ACadSharp.Formats.Tests/src/CSUtilities/CSMath.Tests/TestResults/coverage.info
69 changes: 69 additions & 0 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CSharp

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

defaults:
run:
working-directory: ./src

jobs:
build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: cardinalby/export-env-action@v2
with:
envFile: 'github.env'
- name: Setup submodules
run: git submodule update --init --recursive
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore

testDotNet:
name: Test Dotnet
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: cardinalby/export-env-action@v2
with:
envFile: 'github.env'
- name: Setup submodules
run: git submodule update --init --recursive
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test with the dotnet CLI
run: dotnet test --no-build --no-restore --framework net9.0

testFramework:
name: Test net Framework
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: cardinalby/export-env-action@v2
with:
envFile: 'github.env'
- name: Setup submodules
run: git submodule update --init --recursive
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test with the dotnet CLI
run: dotnet test --no-build --no-restore --framework net48
39 changes: 39 additions & 0 deletions .github/workflows/doc-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: GitHub Pages Documentation

on:
push:
branches: [ master ]

permissions:
contents: write

jobs:
generate:
runs-on: windows-latest
steps:

- name: Checkout
run: git config --global core.autocrlf true
- uses: actions/checkout@v2
with:
submodules: true

- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x

- name: Update Index
run: cp README.md docs/index.md

- name: Install DocFX
run: dotnet tool install -g docfx

- name: Build site
run: docfx docs/docfx.json

- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ github.token }}
publish_dir: ./docs/_site
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish NuGet package

on:
workflow_dispatch:
release:
branches: [ master ]

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Publish NuGet package
working-directory: src
run: |
git submodule update --force --recursive --init --remote
dotnet restore
dotnet build --configuration Release
dotnet pack ./ACadSharp.Formats/ACadSharp.Formats.csproj --configuration Release
foreach($file in (Get-ChildItem ./nupkg -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*.user
*.userosscache
*.sln.docstates
*.env

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
4 changes: 4 additions & 0 deletions github.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SAMPLES_FOLDER: "../../../../../samples"
OUTPUT_SAMPLES_FOLDER: "../../../../../samples/out"
OUTPUT_SVG "../../../../../samples/out/svg"
OUTPUT_PDF "../../../../../samples/out/pdf"
16 changes: 16 additions & 0 deletions push-changes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
echo Prepare commit
#Get commit details
author=`git log -1 --format="%an"`
email=`git log -1 --format="%ae"`

git config --local user.email "$email"
git config --local user.name "$author"
git add .
if git diff-index --quiet HEAD; then
echo "Nothing changed"
exit 0
fi

echo "Pushing changes $BRANCH"
git commit -m "Update project version to $VERSION"
git push origin $BRANCH
2 changes: 1 addition & 1 deletion src/ACadSharp
3 changes: 1 addition & 2 deletions src/ACadSharp.Formats.Tests/ACadSharp.Formats.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>../ACadSharp.Formats.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -35,6 +36,4 @@
<ProjectReference Include="..\ACadSharp.Formats\ACadSharp.Formats.csproj" />
</ItemGroup>

<Import Project="..\CSUtilities\CSUtilities\CSUtilities.projitems" Label="Shared" />

</Project>
20 changes: 20 additions & 0 deletions src/ACadSharp.Formats/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// In SDK-style projects such as this one, several assembly attributes that were historically
// defined in this file are now automatically added during build and populated with
// values defined in project properties. For details of which attributes are included
// and how to customise this process see: https://aka.ms/assembly-info-properties


// Setting ComVisible to false makes the types in this assembly not visible to COM
// components. If you need to access a type in this assembly from COM, set the ComVisible
// attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM.

[assembly: Guid("e9f16aaf-a8f5-4319-abf3-982ce8b7ed6b")]

[assembly: InternalsVisibleTo("ACadSharp.Formats.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b148ab602997d7649ec11cf13981ab8cf9518f0ecdc7cde5f458efb8b94bdbb9c553bc6f2c65fb293bacb5661a374250f1792183b475b91c69eb26ed6eed3094caddf4957f8bfef2ac0ae127ff4e2134d9411b4cad6e83e1d2a0a3aec4c16771d8ad4b31d89099d2d4521b3fd05fb3e1bf1981045c7241e9cbbf65d6cd64fcbd")]
Loading
Loading