Skip to content

Commit 560d27a

Browse files
committed
- Add the zip.sh script
- Add AssemblyInfo.cs to specify the applications version
1 parent e3e10e6 commit 560d27a

9 files changed

Lines changed: 75 additions & 7 deletions

File tree

L80/L80.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<RootNamespace>Konamiman.M80dotNet.L80</RootNamespace>
66
<OutputType>Exe</OutputType>
7+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
8+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
9+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
710
</PropertyGroup>
811

912
<ItemGroup>

LIB80/LIB80.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<OutputType>Exe</OutputType>
66
<RootNamespace>Konamiman.M80dotNet.LIB80</RootNamespace>
7+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
8+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
9+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
710
</PropertyGroup>
811

912
<ItemGroup>

M80/M80.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<RootNamespace>Konamiman.M80dotNet.M80</RootNamespace>
7+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
8+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
9+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
710
</PropertyGroup>
811

912
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -22,6 +25,10 @@
2225
<None Remove="M80.COM" />
2326
</ItemGroup>
2427

28+
<ItemGroup>
29+
<Compile Include="..\Shared\AssemblyInfo.cs" Link="AssemblyInfo.cs" />
30+
</ItemGroup>
31+
2532
<ItemGroup>
2633
<EmbeddedResource Include="M80.COM" />
2734
</ItemGroup>
@@ -36,6 +43,7 @@
3643

3744
<PropertyGroup>
3845
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
46+
<Version>1.0.0</Version>
3947
</PropertyGroup>
4048

4149
</Project>

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ The Z80 binaries used are slightly modified versions of the originals; the chang
2525

2626
Download the latest release and choose the variant you want to use:
2727

28-
* **Portable:** Consists of multiple `.dll` files and runs on any platform having the .NET Core 3.1 runtime installed.
29-
* **Framework-dependant:** Single file, platform-specific applications that also require the .NET Core 3.1 runtime to be installed. This is the perhaps the most convenient variant for frequent use.
30-
* **Standalone:** Single file, platform-specific applications that have the .NET Core runtime built-in and thus have no dependencies (at the expense of much bigger file sizes). These may be convenient for casual usage, or if you just want to give it a try before installing the .NET runtime.
28+
* **Portable:** Consists of multiple `.dll` files and runs on any platform having [the .NET Core Runtime 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1) installed.
29+
* **Framework-dependant:** Single file, platform-specific applications that also require the .NET Core Runtime 3.1 to be installed. This is the perhaps the most convenient variant for frequent use.
30+
* **Self-contained:** Single file, platform-specific applications that have the .NET Core Runtime built-in and thus have no dependencies (at the expense of much bigger file sizes). These may be convenient for casual usage, or if you just want to give it a try before installing the .NET Runtime.
3131

3232
Place the chosen variant in a PATH-accessible directory and then run
3333

3434
M80|L80|LIB80[.exe] [<wrapper command line>] <original program command line>
3535

3636
where `<original program command line>` is the command line you want to pass to the original application, and `<wrapper command line>` are optional extra switches implemented for this project as described below. Example: `M80 -w ~/MyProject -8 =FILE`.
3737

38-
For the portable version you'll need to use the `dotnet` tool (part of the .NET Core runtime) to run the applications from the `.dll` files (so `dotnet M80.dll|L80.dll|LIB80.dll ...`), other than that it works the same way as the platform-specific versions.
38+
For the portable version you'll need to use the `dotnet` tool (part of the .NET Core Runtime) to run the applications from the `.dll` files (so `dotnet M80.dll|L80.dll|LIB80.dll ...`), other than that it works the same way as the platform-specific versions.
3939

4040
## Command line arguments
4141

@@ -106,6 +106,7 @@ Upon termination the applications will return one of the following exit codes:
106106

107107
When running in interactive mode the applications will terminate when pressing CTRL+C or when issuing the appropriate exit command (as defined in the applications manual), the exit code is undefined in this case.
108108

109+
109110
# Developing
110111

111112
## The Z80 part
@@ -119,3 +120,8 @@ The `WINBUILD.BAT` script will use `cpm.exe` and the original `M80.COM` and `L80
119120
The `Shared` project has a `PublishProfiles` folder containing a `build.sh` script and several `.pubxml` files, each containing a publish profile for each of the variants. The script (for Linux, it works on Windows 10 with WSL too) uses the `dotnet` tool to generate all the variants in the `Release` folder in the root directory of the project, you can just run it to build all the variants or pass the name of a publish profile (filename without the `.pubxml`) as a single argument.
120121

121122
If you prefer a more IDE-centric approach for compilation, you can copy all the `.pubxml` files to the `Properties/PublishProfiles` directory of each project, then right-click the project in Visual Studio and select "Publish".
123+
124+
125+
# Last but not least...
126+
127+
...if you like this project **[please consider donating!](http://www.konamiman.com/msx/msx-e.html#donate)** My kids need moar shoes!

Shared/AssemblyInfo.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using System.Reflection;
2+
3+
[assembly: AssemblyVersion("1.0")]
4+
[assembly: AssemblyFileVersion("1.0")]

Shared/ProgramRunner.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,11 @@ private void ShowHelpAndExit()
245245

246246
private void ShowBanner()
247247
{
248+
// Version number is specified in Shared/AssemblyInfo.cs (and linked in the other projects)
249+
var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(2);
250+
248251
Console.WriteLine(
249-
@$"{ProgramName} .NET wrapper 1.0
252+
@$"{ProgramName} .NET wrapper {version}
250253
By Konamiman, 2020");
251254
}
252255

Shared/PublishProfiles/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Build all the programs on all the publish profiles if ran without arguments.
66
# Or build only the publish profile supplied as argument (e.g: build.sh SelfContained__win_x64)
7-
# The built programs are placed in <solution root>\Release.
7+
# The built programs are placed in <solution root>/Release.
88

99
output() {
1010
echo "$(tput setaf "$1")$2$(tput sgr0)"

Shared/PublishProfiles/zip.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
3+
# This script needs to be run from its own directory!
4+
5+
# Generate ZIP files for all the variants inside the <solution root>/Release/zips directory.
6+
# You need to run build.sh first in order to actually have something to zip!
7+
8+
output() {
9+
echo "$(tput setaf "$1")$2$(tput sgr0)"
10+
}
11+
12+
banner() {
13+
echo
14+
output 6 "----- $1 -----"
15+
echo
16+
}
17+
18+
set -e
19+
20+
if [ -z "$(which zip)" ]; then
21+
output 1 "*** zip is not installed!"
22+
exit 1
23+
fi
24+
25+
version=$(grep 'AssemblyVersion' ../AssemblyInfo.cs | grep -Eo '[0-9.]+')
26+
27+
cd ../../Release
28+
mkdir -p zips
29+
rm -rf zips/*
30+
31+
for DIR in $(find * -type d ! -path "zips" ! -path "FrameworkDependant" ! -path "SelfContained"); do
32+
banner $DIR
33+
zip -r -j zips/M80dotNet_${version}_$(echo $DIR | tr '/' '_').zip $DIR
34+
done
35+
36+
cd -
37+
38+
echo
39+
output 3 "ZIPs generation succeeded!"

Shared/Shared.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<RootNamespace>Konamiman.M80dotNet</RootNamespace>
6+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
7+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
68
</PropertyGroup>
79

810
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

0 commit comments

Comments
 (0)