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
5 changes: 3 additions & 2 deletions .github/workflows/build-debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
steps:
- uses: Cysharp/Actions/.github/actions/checkout@main
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
- run: dotnet build -c Debug
- run: dotnet test -c Debug --no-build
- run: dotnet build -c Release
- run: dotnet test -c Release --no-build
- run: dotnet pack -c Release --no-build

build-unity:
if: ${{ (github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:') }}
Expand Down
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ _ReSharper*
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
Expand All @@ -77,7 +77,19 @@ publish
*.Publish.xml

# NuGet Packages Directory
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
# packages # upm pacakge will use Packages
# **/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
# !**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Windows Azure Build Output
csx
Expand Down Expand Up @@ -107,9 +119,6 @@ UpgradeLog*.XML
.vs/config/applicationhost.config
.vs/restore.dg

nuget/tools/*
nuget/*.nupkg
nuget/*.unitypackage
.vs/

# Jetbrains Rider
Expand Down
32 changes: 32 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>disable</ImplicitUsings>

<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)opensource.snk</AssemblyOriginatorKeyFile>

<!-- NuGet Package Information -->
<IsPackable>false</IsPackable>
<PackageVersion>$(Version)</PackageVersion>
<Company>Cysharp</Company>
<Authors>Cysharp</Authors>
<Copyright>© Cysharp, Inc.</Copyright>
<PackageTags>memory</PackageTags>
<PackageProjectUrl>https://github.com/Cysharp/NativeMemoryArray</PackageProjectUrl>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>Icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)Icon.png" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)LICENSE" />
</ItemGroup>
</Project>
File renamed without changes
27 changes: 13 additions & 14 deletions sandbox/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.IO.Pipelines" Version="6.0.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.IO.Pipelines" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NativeMemoryArray\NativeMemoryArray.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\NativeMemoryArray\NativeMemoryArray.csproj" />
</ItemGroup>

</Project>
71 changes: 26 additions & 45 deletions src/NativeMemoryArray/NativeMemoryArray.csproj
Original file line number Diff line number Diff line change
@@ -1,53 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>9.0</LangVersion>
<RootNamespace>Cysharp.Collections</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<RootNamespace>Cysharp.Collections</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>

<!-- NuGet Packaging -->
<PackageVersion>$(Version)</PackageVersion>
<Company>Cysharp</Company>
<Authors>Cysharp</Authors>
<Copyright>© Cysharp, Inc.</Copyright>
<PackageTags>memory</PackageTags>
<Description>Utilized native-memory backed array for .NET and Unity.</Description>
<PackageProjectUrl>https://github.com/Cysharp/NativeMemoryArray</PackageProjectUrl>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../opensource.snk</AssemblyOriginatorKeyFile>
<PackageIcon>Icon.png</PackageIcon>
<IsPackable>true</IsPackable>
</PropertyGroup>
<!-- NuGet Packaging -->
<Description>Utilized native-memory backed array for .NET and Unity.</Description>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) != 'net6.0'">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) != 'net6.0'">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="Icon.png" Pack="true" PackagePath="/" />
</ItemGroup>
<!-- Copy files for Unity -->
<PropertyGroup>
<DestinationRoot>$(MSBuildProjectDirectory)\..\NativeMemoryArray.Unity\Assets\Plugins\NativeMemoryArray\Runtime\</DestinationRoot>
</PropertyGroup>
<ItemGroup>
<TargetFiles1 Include="$(MSBuildProjectDirectory)\**\*.cs" Exclude="**\bin\**\*.*;**\obj\**\*.*;_InternalVisibleTo.cs" />
</ItemGroup>

<!-- Copy files for Unity -->
<PropertyGroup>
<DestinationRoot>$(MSBuildProjectDirectory)\..\NativeMemoryArray.Unity\Assets\Plugins\NativeMemoryArray\Runtime\</DestinationRoot>
</PropertyGroup>
<ItemGroup>
<TargetFiles1 Include="$(MSBuildProjectDirectory)\**\*.cs" Exclude="**\bin\**\*.*;**\obj\**\*.*;_InternalVisibleTo.cs" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(TargetFiles1)" DestinationFiles="$(DestinationRoot)\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="true" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(TargetFiles1)" DestinationFiles="$(DestinationRoot)\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="true" />
</Target>
</Project>
53 changes: 26 additions & 27 deletions tests/NativeMemoryArray.Tests/NativeMemoryArray.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
<TargetFrameworks>net480;net6.0</TargetFrameworks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)'!='true'">
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
<TargetFrameworks>net480;net6.0</TargetFrameworks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)'!='true'">
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<LangVersion>10.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>NativeMemoryArrayTests</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>NativeMemoryArrayTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NativeMemoryArray\NativeMemoryArray.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\NativeMemoryArray\NativeMemoryArray.csproj" />
</ItemGroup>
</Project>
Loading