Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoonlight committed Apr 14, 2019
1 parent c053cde commit fa59611
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/NSmartProxyClient/NSmartProxyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ static void Main(string[] args)
{
Logger.Error(e.Message);
}

Logger.Info("Client terminated,press any key to continue.");
Console.Read();
Logger.Info("Client terminated,press any key to continue.");

}

private static async Task StartClient()
Expand Down
5 changes: 1 addition & 4 deletions src/NSmartProxyWinform/ClientMngr.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions src/NSmartProxyWinform/ClientMngr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ private void ShowInExplorer_Click(object sender, EventArgs e)

//记录日志
string argument = "/select, \"" + filePath + "\"";
//Logging.Debug(argument);
System.Diagnostics.Process.Start("explorer.exe", argument);
}

Expand Down Expand Up @@ -247,8 +246,6 @@ private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
tbxTargetServerAddr.Text = strParts[2].Trim();
tbxTargetServerPort.Text = strParts[3].Trim();
}


}


Expand Down Expand Up @@ -323,11 +320,6 @@ private void tbxTargetServerPort_KeyPress(object sender, KeyPressEventArgs e)
}
}

private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
{

}

private void 启动内网穿透ToolStripMenuItem_Paint(object sender, PaintEventArgs e)
{
if (IsStarted)
Expand Down Expand Up @@ -372,12 +364,6 @@ private void RefreshFormFormConfig()
}
}

private void timer1_Tick(object sender, EventArgs e)
{
//1.刷新配置

//2.保存配置到文件
}

private void btnSaveConfig_Click(object sender, EventArgs e)
{
Expand Down
33 changes: 33 additions & 0 deletions src/NSmartProxyWinform/NSmartProxyWinform.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -32,6 +49,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>nsp.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
Expand Down Expand Up @@ -150,9 +170,22 @@
<None Include="Resources\base_checkmark_32.png" />
</ItemGroup>
<ItemGroup>
<Content Include="nsp.ico" />
<Content Include="Resources\servicepaused.ico" />
<Content Include="Resources\servicerunning.ico" />
<None Include="Resources\servicestopped.ico" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added src/NSmartProxyWinform/nsp.ico
Binary file not shown.
31 changes: 27 additions & 4 deletions src/build.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
cd ./NSmartProxy.ClientRouter
rem #run before install wrap tool.
rem #eg.: dotnet tool install -g dotnet-warp
dotnet-warp -l aggressive --verbose
rem NSP v0.3
set Ver=v0.3
set BuildPath=%~dp0/../build

set nsp_server_path=%BuildPath%/nspclient_%Ver%
set nsp_client_path=%BuildPath%/nspserver_%Ver%
set nsp_client_winfform_path=%BuildPath%/nspclient_winform_%Ver%

rem del %~dp0/../build/*.*
rem NSPClient
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -o %nsp_server_path%

rem NSPServer
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -o %nsp_client_path%

rem NSPWinform
MSBuild .\NSmartProxyWinform\NSmartProxyWinform.csproj /t:build /p:OutDir=%nsp_client_winfform_path%
powershell del %nsp_client_winfform_path%/*.pdb
powershell del %nsp_client_winfform_path%/*.xml

rem ilmerge
rem ruined :<

rem compress
powershell Compress-Archive -Path '%nsp_server_path%/*.*' -DestinationPath '%BuildPath%/nspclient_%Ver%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_path%/*.*' -DestinationPath '%BuildPath%/nspserver_%Ver%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_winfform_path%/*.*' -DestinationPath '%BuildPath%/nspclient_winform_%Ver%.zip' -Force
Binary file added src/build.ps
Binary file not shown.

0 comments on commit fa59611

Please sign in to comment.