Skip to content

Commit

Permalink
Merge branch 'devel' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed Jun 3, 2023
2 parents 337a364 + e723811 commit 5b65dc2
Show file tree
Hide file tree
Showing 24 changed files with 254 additions and 152 deletions.
84 changes: 68 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,87 @@
name: .NET

on: [push, pull_request, workflow_dispatch]
on: [push]

jobs:
build:

runs-on: windows-latest

steps:

#-----------------------------------------------------------------------
# Checkout

- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core 2.1
# lfs: true
#- name: Checkout LFS objects
# run: git lfs checkout

- name: Extract branch name
id: extract_branch_name
run: |
$branch_name=$(git name-rev --name-only --exclude=tags/* HEAD)
echo "Detected current branch: ${branch_name}"
echo "::set-output name=branch_name::${branch_name}"
#-----------------------------------------------------------------------
# Setup environments

- name: Setup .NET 2.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.811
- name: Setup .NET Core 3.1
dotnet-version: 2.2.*
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.404
dotnet-version: 3.1.*
- name: Setup .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
- name: Install dependencies
run: dotnet restore MeCab.Dotnet/MeCab.Dotnet.csproj
- name: Install dependencies (Tests)
run: dotnet restore MeCab.Dotnet.Tests/MeCab.Dotnet.Tests.csproj
dotnet-version: 5.0.*
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.*
- name: Setup .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.*

- name: Setup NuGet package reference
run: |
# dotnet nuget add source ${{secrets.GH_LOCAL_NUGET_URL}} -n ref1 -u ${{secrets.GH_LOCAL_NUGET_USER}} -p ${{secrets.GH_LOCAL_NUGET_PASSWORD}} --store-password-in-clear-text --configfile nuget.config
# dotnet nuget add source ${{secrets.GH_NUGET_URL}} -n ref2 -u ${{secrets.GH_NUGET_USER}} -p ${{secrets.GH_NUGET_PASSWORD}} --store-password-in-clear-text --configfile nuget.config

#-----------------------------------------------------------------------
# Build

- name: NuGet restore
run: dotnet restore -p:Configuration=Release MeCab.DotNet.sln

- name: Build
run: dotnet build --configuration Release --no-restore MeCab.Dotnet/MeCab.Dotnet.csproj
- name: Build (Test)
run: dotnet build --configuration Release --no-restore MeCab.Dotnet.Tests/MeCab.Dotnet.Tests.csproj
run: dotnet build -p:Configuration=Release -p:BuildIdentifier=${GITHUB_RUN_NUMBER} MeCab.DotNet.sln

- name: Build NuGet packages
run: dotnet pack -p:Configuration=Release -p:BuildIdentifier=${GITHUB_RUN_NUMBER} -o artifacts MeCab.DotNet.sln

#-----------------------------------------------------------------------
# Test

- name: Test
run: dotnet test --no-restore --verbosity normal MeCab.Dotnet.Tests/MeCab.Dotnet.Tests.csproj
run: dotnet test --no-restore --verbosity normal -p:CITest=True MeCab.DotNet.sln
timeout-minutes: 10

#-----------------------------------------------------------------------
# Deploy packages (develop)

#- name: Deploy NuGet package (develop/ref1)
# if: startsWith( github.ref, 'refs/tags/' )
# run: dotnet nuget push artifacts/MeCab.DotNet.*.nupkg --source ref1

#-----------------------------------------------------------------------
# Deploy packages (main)

#- name: Deploy NuGet package (main/ref2)
# if: (startsWith( github.ref, 'refs/tags/' )) && (endsWith(steps.extract_branch_name.outputs.branch_name, 'main'))
# run: dotnet nuget push artifacts/MeCab.DotNet.*.nupkg --source ref1
60 changes: 60 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<Project>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Platforms>AnyCPU</Platforms>

<DebugSymbols>true</DebugSymbols>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/kekyo/MeCab.DotNet.git</RepositoryUrl>
<IsPackable>false</IsPackable>

<RootNamespace>MeCab</RootNamespace>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1570;CS1572;CS1573;CS1591;CA1416;CS8981</NoWarn>

<Product>MeCab.DotNet</Product>
<Trademark>MeCab.DotNet</Trademark>
<Copyright>Copyright (c) 2001-2008, Taku Kudo; Copyright (c) 2004-2008, Nippon Telegraph and Telephone Corporation; Copyright (c) 2015 Tsuyoshi Komuta; Portions Copyright (c) 2019-2021 Kouji Matsui</Copyright>

<Description>MeCab.DotNet - Morphological analysis engine for .NET 7,6,5, .NET Core and .NET Frameworks managed library.</Description>
<Company>Nippon Telegraph and Telephone Corporation</Company>
<Authors>Taku Kudo; Tsuyoshi Komuta; Kouji Matsui (@kozy_kekyo)</Authors>
<PackageLicenseExpression>GPL-2.0-only OR LGPL-2.1-only</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/kekyo/MeCab.DotNet.git</PackageProjectUrl>
<PackageIcon>MeCab.DotNet-100.png</PackageIcon>
<PackageTags>mecab;morphological;analysis</PackageTags>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<NoWarn>$(NoWarn);NU1605;NU1701;NU1803</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' != 'Release'">
<DebugType>portable</DebugType>
<Deterministic>false</Deterministic>
<EmbedUntrackedSources>false</EmbedUntrackedSources>
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>embedded</DebugType>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="RelaxVersioner" Version="2.14.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

</Project>
15 changes: 4 additions & 11 deletions MeCab.DotNet.Tests/MeCab.DotNet.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1;net5.0</TargetFrameworks>
<RootNamespace>MeCab</RootNamespace>

<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net48;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
39 changes: 23 additions & 16 deletions MeCab.DotNet.sln
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29326.143
# Visual Studio Version 17
VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MeCab.DotNet", "MeCab.DotNet\MeCab.DotNet.csproj", "{3EE156E1-FEDE-4EC5-B64A-3287EC3AB2E3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsFormsSample", "WindowsFormsSample\WindowsFormsSample.csproj", "{BAB9F854-1C9A-4BF6-83C0-DE3F516547E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerformanceTest", "PerformanceTest\PerformanceTest.csproj", "{5BF64AE2-E2D4-40E4-BBCC-2F185717AA25}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MeCab.DotNet.Tests", "MeCab.DotNet.Tests\MeCab.DotNet.Tests.csproj", "{59B69A5D-B54E-4659-9CD6-502FCD7B0881}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{322FBF2B-4698-4887-9578-C70080C96E05}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
BSD = BSD
build-nupkg.bat = build-nupkg.bat
build-nupkg.sh = build-nupkg.sh
.github\workflows\build.yml = .github\workflows\build.yml
COPYING = COPYING
Directory.Build.props = Directory.Build.props
LGPL = LGPL
LICENSE = LICENSE
README.ja.md = README.ja.md
README.md = README.md
.github\workflows\build.yml = .github\workflows\build.yml
build-nupkg.sh = build-nupkg.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{13615BDE-BA2F-41A8-9A75-EEBF5CA290C9}"
Expand All @@ -33,6 +30,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{13615B
Images\README.md = Images\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{A535BFA3-6093-4330-BB1C-DE1FCD23264F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerformanceTest", "samples\PerformanceTest\PerformanceTest.csproj", "{1ED95223-6D45-41A1-915A-01FE18A44DCC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsFormsSample", "samples\WindowsFormsSample\WindowsFormsSample.csproj", "{BFD819A2-DEE0-4677-B4FA-A06089ECBA96}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -43,22 +46,26 @@ Global
{3EE156E1-FEDE-4EC5-B64A-3287EC3AB2E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3EE156E1-FEDE-4EC5-B64A-3287EC3AB2E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3EE156E1-FEDE-4EC5-B64A-3287EC3AB2E3}.Release|Any CPU.Build.0 = Release|Any CPU
{BAB9F854-1C9A-4BF6-83C0-DE3F516547E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAB9F854-1C9A-4BF6-83C0-DE3F516547E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAB9F854-1C9A-4BF6-83C0-DE3F516547E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAB9F854-1C9A-4BF6-83C0-DE3F516547E1}.Release|Any CPU.Build.0 = Release|Any CPU
{5BF64AE2-E2D4-40E4-BBCC-2F185717AA25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BF64AE2-E2D4-40E4-BBCC-2F185717AA25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BF64AE2-E2D4-40E4-BBCC-2F185717AA25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5BF64AE2-E2D4-40E4-BBCC-2F185717AA25}.Release|Any CPU.Build.0 = Release|Any CPU
{59B69A5D-B54E-4659-9CD6-502FCD7B0881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59B69A5D-B54E-4659-9CD6-502FCD7B0881}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59B69A5D-B54E-4659-9CD6-502FCD7B0881}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59B69A5D-B54E-4659-9CD6-502FCD7B0881}.Release|Any CPU.Build.0 = Release|Any CPU
{1ED95223-6D45-41A1-915A-01FE18A44DCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ED95223-6D45-41A1-915A-01FE18A44DCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ED95223-6D45-41A1-915A-01FE18A44DCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ED95223-6D45-41A1-915A-01FE18A44DCC}.Release|Any CPU.Build.0 = Release|Any CPU
{BFD819A2-DEE0-4677-B4FA-A06089ECBA96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFD819A2-DEE0-4677-B4FA-A06089ECBA96}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFD819A2-DEE0-4677-B4FA-A06089ECBA96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFD819A2-DEE0-4677-B4FA-A06089ECBA96}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1ED95223-6D45-41A1-915A-01FE18A44DCC} = {A535BFA3-6093-4330-BB1C-DE1FCD23264F}
{BFD819A2-DEE0-4677-B4FA-A06089ECBA96} = {A535BFA3-6093-4330-BB1C-DE1FCD23264F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1FAB0102-E077-48E3-A3EE-943C2750F25A}
EndGlobalSection
Expand Down
2 changes: 1 addition & 1 deletion MeCab.DotNet/Extension/FeatureExtension.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET35 || NET40 || NET45 || NETSTANDARD1_3 || NETSTANDARD2_0 || NETSTANDARD2_1 || NET5_0
#if !NET20
using MeCab;
using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion MeCab.DotNet/Extension/IpaDic/IpaDicFeatureExtension.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET35 || NET40 || NET45 || NETSTANDARD1_3 || NETSTANDARD2_0 || NETSTANDARD2_1 || NET5_0
#if !NET20
using MeCab;
using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion MeCab.DotNet/Extension/UniDic/UniDicFeatureExtension.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET35 || NET40 || NET45 || NETSTANDARD1_3 || NETSTANDARD2_0 || NETSTANDARD2_1 || NET5_0
#if !NET20
using MeCab;
using System;
using System.Collections.Generic;
Expand Down
37 changes: 3 additions & 34 deletions MeCab.DotNet/MeCab.DotNet.csproj
Original file line number Diff line number Diff line change
@@ -1,46 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net20;net35;net40-client;net45;netstandard1.3;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<RootNamespace>MeCab</RootNamespace>

<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net20;net35;net40-client;net45;net461;net48;net481;netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591,1572,1573</NoWarn>
<RepositoryUrl>https://github.com/kekyo/MeCab.DotNet.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<IsPackable>true</IsPackable>

<PackageId>MeCab.DotNet</PackageId>
<AssemblyTitle>MeCab.DotNet - Morphological analysis engine for .NET 5, .NET Core 1/2/3 and .NET Frameworks managed library.</AssemblyTitle>
<Product>MeCab.DotNet</Product>
<Trademark>MeCab.DotNet</Trademark>
<Copyright>Copyright (c) 2001-2008, Taku Kudo; Copyright (c) 2004-2008, Nippon Telegraph and Telephone Corporation; Copyright (c) 2015 Tsuyoshi Komuta; Portions Copyright (c) 2019-2021 Kouji Matsui</Copyright>
<Description>MeCab.DotNet - Morphological analysis engine for .NET 5, .NET Core 1/2/3 and .NET Frameworks managed library.</Description>
<Company>Nippon Telegraph and Telephone Corporation</Company>
<Authors>Taku Kudo; Tsuyoshi Komuta; Kouji Matsui (@kozy_kekyo)</Authors>
<PackageLicenseExpression>GPL-2.0-only OR LGPL-2.1-only</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/kekyo/MeCab.DotNet.git</PackageProjectUrl>
<PackageIcon>MeCab.DotNet-100.png</PackageIcon>
<PackageTags>mecab;morphological;analysis</PackageTags>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AssemblyTitle>MeCab.DotNet - Morphological analysis engine for .NET 7,6,5, .NET Core and .NET Frameworks managed library.</AssemblyTitle>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net35'">
<PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net35'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="RelaxVersioner" Version="2.1.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<None Remove="app.config" />
<None Remove="dic\*" />
Expand Down

0 comments on commit 5b65dc2

Please sign in to comment.