Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yomunsam committed Jul 2, 2020
1 parent 0e26477 commit 73a6af0
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 1 deletion.
1 change: 1 addition & 0 deletions NekoSheet.Console/NekoSheet.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nekonya.Common" Version="1.0.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20303.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion NekoSheet.Console/NekoSheet.Console.csproj.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LastSelectedProfileId>E:\DevWork\Nekonya\NekoSheet\NekoSheet.Console\Properties\PublishProfiles\linux64_框架依赖.pubxml</_LastSelectedProfileId>
<_LastSelectedProfileId>E:\DevWork\Nekonya\NekoSheet\NekoSheet.Console\Properties\PublishProfiles\OSX64_框架依赖.pubxml</_LastSelectedProfileId>
</PropertyGroup>
</Project>
12 changes: 12 additions & 0 deletions NekoSheet.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using System.CommandLine;
using System.CommandLine.Invocation;
using Nekonya;

namespace NekoSheet
{
Expand Down Expand Up @@ -78,6 +79,17 @@ static string[] GetSheetFileNames(string path)
/// <returns></returns>
static string GetOutputName(string outputPath,string filePath, char commentChar)
{
if(outputPath.IsNullOrEmpty())
{
string file_name = Path.GetFileNameWithoutExtension(filePath);
int _comment = file_name.IndexOf(commentChar);
if (_comment > 0)
{
file_name = file_name.Substring(0, _comment);
}
return Path.Combine(Path.GetDirectoryName(filePath), file_name + ".json");
}

if (Directory.Exists(outputPath))
{
//给定的路径是个文件夹,也就是说要自动生成文件名
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\netcoreapp3.1\publish_linux_arm</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\netcoreapp3.1\publish_osx64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
18 changes: 18 additions & 0 deletions NekoSheet.Console/Properties/PublishProfiles/win64_独立.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\netcoreapp3.1\publish_win_64_single</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishTrimmed>True</PublishTrimmed>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
8 changes: 8 additions & 0 deletions NekoSheet.Console/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"NekoSheet.Console": {
"commandName": "Project",
"commandLineArgs": "--path C:\\Users\\yomun\\Desktop\\NekoSheet_Tpl.xlsx"
}
}
}

0 comments on commit 73a6af0

Please sign in to comment.