Skip to content

Gfs/add win7 support #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 1, 2019
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
21 changes: 21 additions & 0 deletions Cli/AttackSurfaceAnalyzerCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,31 @@
<ItemGroup>
<ProjectReference Include="..\Lib\AttackSurfaceAnalyzerLib.csproj" />
<Content Include="Output\Output.cshtml" CopyToPublishDirectory="PreserveNewest" />
<Content Include="..\LICENSE.txt">
<Link>LICENSE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\NOTICE.txt">
<Link>NOTICE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\PRIVACY.md">
<Link>PRIVACY.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\README.md">
<Link>README.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Compile Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="Program.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
</ItemGroup>
</Project>
37 changes: 19 additions & 18 deletions Cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ EXEC_NAME = AttackSurfaceAnalyzerCli
NBGV_DIR = ../Tools
VERSION := $(shell $(NBGV_DIR)/nbgv get-version -v AssemblyInformationalVersion)
UNAME_S := $(shell uname -s)
PUBLISH_PATH = bin/AttackSurfaceAnalyzerCli

ifeq ($(OS),Windows_NT)
RUNTIME = win10-x64
Expand All @@ -21,25 +22,33 @@ else
endif
endif

PUBLISH_DIR = bin/AttackSurfaceAnalyzerCli-$(ALT_RUNTIME)-$(VERSION)
PUBLISH_DIR = "bin/AttackSurfaceAnalyzerCli-$(ALT_RUNTIME)-$(VERSION)"

prerequisites:
$(info Checking for nbgv, installing if required.)
@which $(NBGV_DIR)/nbgv || dotnet tool install --tool-path $(NBGV_DIR)/ nbgv
$(info Setting publish directory $(PUBLISH_DIR))

all: prerequisites debug
debug: prerequisites clean restore build_debug
release: prerequisites clean restore build_release
all: win mac linux
win: RUNTIME = win10-x64

all: win win10 mac linux

win: RUNTIME = win-x86
win: ALT_RUNTIME = win
win: build_release
win: prerequisites clean restore build_release

win10: RUNTIME = win10-x64
win10: ALT_RUNTIME = win10
win10: build_release prerequisites clean restore build_release

mac: RUNTIME = osx-x64
mac: ALT_RUNTIME = macos
mac: build_release
mac: build_release prerequisites clean restore build_release

linux: RUNTIME = linux-x64
linux: ALT_RUNTIME = linux
linux: build_release
linux: build_release prerequisites clean restore build_release

clean:
$(info Cleaning...)
Expand All @@ -55,14 +64,6 @@ build_debug:
$(info Debug build completed.)

build_release:
$(info Building release...)
$(info Detected version as $(VERSION))

$(DOTNET) publish -c Release -r $(RUNTIME) --self-contained true --output $(PUBLISH_DIR)
$(info Release build completed)

build_win:
$(info Building windows...)
RUNTIME = win-x64
ALT_RUNTIME = win
build_release
$(info Building $(RUNTIME) release at $(VERSION))
$(DOTNET) publish -c Release -r $(RUNTIME) --self-contained true --output $(PUBLISH_PATH)-$(ALT_RUNTIME)-$(VERSION)
$(info Release build completed)
2 changes: 1 addition & 1 deletion Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class MonitorCommandOptions
[Option('d', "directories", Required = false, HelpText = "Comma-separated list of directories to monitor.")]
public string MonitoredDirectories { get; set; }

[Option('i', "interrogate-file-changes", Required = false, HelpText = "On a file create or change gather the post-change file size and security attributes")]
[Option('i', "interrogate-file-changes", Required = false, HelpText = "On a file create or change gather the post-change file size and security attributes (Linux/Mac only)")]
public bool InterrogateChanges { get; set; }

//[Option('r', "registry", Required = false, HelpText = "Monitor the registry for changes. (Windows Only)")]
Expand Down
18 changes: 18 additions & 0 deletions Gui/AttackSurfaceAnalyzerGui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="..\LICENSE.txt">
<Link>LICENSE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\NOTICE.txt">
<Link>NOTICE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\PRIVACY.md">
<Link>PRIVACY.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\README.md">
<Link>README.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
70 changes: 70 additions & 0 deletions Gui/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.DEFAULT_GOAL := debug

DOTNET = dotnet
TARGET = netcoreapp2.2
EXEC_NAME = AttackSurfaceAnalyzerCli
TOOL_DIR = ../Tools
ELECTRON = $(TOOL_DIR)/electronize
CUSTOM_FEED = ../Tools/packages/
VERSION := $(shell $(TOOL_DIR)/nbgv get-version -v AssemblyInformationalVersion)
UNAME_S := $(shell uname -s)
ELECTRON_OUTPUT = bin/made/
PUBLISH_PATH = bin/AttackSurfaceAnalyzerGui

ifeq ($(OS),Windows_NT)
RUNTIME = win
ALT_RUNTIME = win
else
ifeq ($(UNAME_S),Linux)
RUNTIME = linux
ALT_RUNTIME = linux
endif
ifeq ($(UNAME_S),Darwin)
RUNTIME = osx
ALT_RUNTIME = macos
endif
endif


prerequisites:
$(info Checking for nbgv, installing if required.)
@which $(TOOL_DIR)/nbgv || dotnet tool install --tool-path $(TOOL_DIR)/ nbgv
$(info Checking for electronNET.cli, installing if required.)

@which $(TOOL_DIR)/electronize || dotnet tool install --tool-path $(TOOL_DIR)/ --version 0.0.11-custom --add-source $(CUSTOM_FEED) electronnet.cli
$(info Setting publish directory $(PUBLISH_DIR))

debug: prerequisites clean restore build_debug
release: prerequisites clean restore build_release

all: win win10 mac linux

win: RUNTIME = win
win: ALT_RUNTIME = win
win: prerequisites clean restore build_release

mac: RUNTIME = osx
mac: RUNTIME = macos
mac: build_release prerequisites clean restore build_release

linux: RUNTIME = linux
linux: RUNTIME = linux
linux: build_release prerequisites clean restore build_release

clean:
$(info Cleaning...)
dotnet clean

restore:
$(info Restoring...)
dotnet restore

build_debug:
$(info Building debug...)
$(ELECTRON) start
$(info Debug build started.)

build_release:
$(info Building $(RUNTIME) release at $(VERSION))
mkdir -p $(PUBLISH_PATH)-$(ALT_RUNTIME)-$(VERSION) && $(ELECTRON) build /target $(RUNTIME) /package-json package.json /relative-path $(PUBLISH_PATH)-$(ALT_RUNTIME)-$(VERSION)
$(info Built release at $(ELECTRON_OUTPUT))
File renamed without changes.
18 changes: 18 additions & 0 deletions Lib/AttackSurfaceAnalyzerLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,22 @@ This NuGet contains the AttackSurfaceAnalyzer Library, which is used by the CLI
</PackageReference>
<PackageReference Include="System.Net.Security" Version="4.3.2" />
</ItemGroup>
<ItemGroup>
<Content Include="..\LICENSE.txt">
<Link>LICENSE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\NOTICE.txt">
<Link>NOTICE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\PRIVACY.md">
<Link>PRIVACY.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\README.md">
<Link>README.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
File renamed without changes.