Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Dec 23, 2021
1 parent e573948 commit f4ba7d6
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 56 deletions.
39 changes: 0 additions & 39 deletions HACKING.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Cache NuGet Packages for Offline use

![](./docs/recording.gif)
![](./docs/img/recording.gif)

NuSave gives you the ability to cache NuGet packages from nuget.org or
any other source with full dependency tree to your computer for offline use.
Expand Down
24 changes: 24 additions & 0 deletions docs/Deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Publish

### Tag
```shell
git tag -d v1.2.3 && git push --delete origin v1.2.3
git tag v1.2.3 && git push origin --tags
```

### Build release artifacts

Windows:
```shell
./scripts/deploy.sh win-x64
```

macOS:
```shell
./scripts/deploy.sh osx-x64
```

Linux:
```shell
./scripts/deploy.sh linux-x64
```
File renamed without changes
14 changes: 3 additions & 11 deletions nusave.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.25928.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuSave.Core", "NuSave.Core\NuSave.Core.csproj", "{FE24E5C3-507C-4198-93B5-A012AF0408BD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuSave.Core", "src\Core\NuSave.Core.csproj", "{FE24E5C3-507C-4198-93B5-A012AF0408BD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nusave", "nusave\nusave.csproj", "{8C7D84C7-3345-4567-8745-17C85EB93277}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuSave.CommandLine", "src\CommandLine\NuSave.CommandLine.csproj", "{8C7D84C7-3345-4567-8745-17C85EB93277}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Things", "Things", "{24ADCE77-9560-40CB-BE68-D5DE0B1A8351}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
LICENSE = LICENSE
HACKING.md = HACKING.md
.gitignore = .gitignore
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuSave.Tests", "NuSave.Tests\NuSave.Tests.csproj", "{81FD7525-AC02-470E-BD90-4A9F2866A2BC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuSave.Tests", "test\NuSave.Tests.csproj", "{81FD7525-AC02-470E-BD90-4A9F2866A2BC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
16 changes: 16 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
arch="$1"
publishDir=./bin/Release/net5.0/${arch}/publish
rm -rf ${publishDir}/*
cd ./src/CommandLine && \
dotnet publish -c Release -r ${arch} -p:PublishSingleFile=true --self-contained true && \
mkdir -p ../../dist && \
cd ${publishDir} && \
if test -f ./NuSave.CommandLine; then
mv NuSave.CommandLine nusave
fi
if test -f ./NuSave.CommandLine.exe; then
mv NuSave.CommandLine.exe nusave.exe
fi
zip -r ../../../../../../../dist/nusave-3.0.0-${arch}.zip . && \
cd ../../../../../../../
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>NuSave</RootNamespace>
<RootNamespace>NuSave.CommandLine</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NuSave.Core\NuSave.Core.csproj" />
<ProjectReference Include="..\Core\NuSave.Core.csproj" />
</ItemGroup>
</Project>
6 changes: 5 additions & 1 deletion nusave/Program.cs → src/CommandLine/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NuSave
namespace NuSave.CommandLine
{
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -35,6 +35,7 @@ private static void CacheCommand(CommandLineApplication app)
{
app.Command("cache", target =>
{
target.HelpOption("--help | -h");
SlnCommand(target);
CsprojCommand(target);
PackageCommand(target);
Expand All @@ -53,6 +54,7 @@ private static void SlnCommand(CommandLineApplication target)

target.Command("sln", sln =>
{
sln.HelpOption("--help | -h");
slnPath = sln.Argument("path", "Solution file (.sln)");
sources = sln.Option("--source", "Additional sources, comma separated", CommandOptionType.SingleValue);
targetFrameworks = sln.Option("--targetFrameworks",
Expand Down Expand Up @@ -98,6 +100,7 @@ private static void CsprojCommand(CommandLineApplication target)

target.Command("csproj", csproj =>
{
csproj.HelpOption("--help | -h");
csprojPath = csproj.Argument("path", "Project file (.csproj)");
sources = csproj.Option("--source", "Additional sources, comma separated", CommandOptionType.SingleValue);
targetFrameworks = csproj.Option("--targetFrameworks",
Expand Down Expand Up @@ -142,6 +145,7 @@ private static void PackageCommand(CommandLineApplication target)

target.Command("package", package =>
{
package.HelpOption("--help | -h");
idAndVersion = package.Argument("id@version", "Package ID and Version, example: [email protected]");
sources = package.Option("--source", "Additional sources, comma separated", CommandOptionType.SingleValue);
targetFrameworks = package.Option("--targetFrameworks",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace NuSave.Tests
using Core;

[TestClass]
public class UnitTests
public class DependencyResolverTests
{
[TestMethod]
public void TestDependencyResolver()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<PackageReference Include="coverlet.collector" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NuSave.Core\NuSave.Core.csproj" />
<ProjectReference Include="..\src\Core\NuSave.Core.csproj" />
</ItemGroup>
</Project>

0 comments on commit f4ba7d6

Please sign in to comment.