Skip to content

Commit 0e6d82b

Browse files
author
kuiper
committed
Update for pupnet v1.8
1 parent 818360c commit 0e6d82b

File tree

7 files changed

+106
-54
lines changed

7 files changed

+106
-54
lines changed

CHANGES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,31 @@ using the ${APPSTREAM_CHANGELOG_XML} macro. This means the version changes need
1313
The changelog parser should do a robust job at parsing version information while ignoring superfluous README text
1414
(such as this), but care should be taken to ensure that version information is correctly formatted.
1515

16+
+ Version 1.0.4; 2024-03-18
17+
- Updated for pupnet 1.8.0.
18+
- Add multiple checks for DefineConstants.
19+
- Project file updated to .NET8.
20+
21+
1622
+ Version 1.0.3; 2023-05-04
1723
- The pupnet.conf file upgraded to version 1.4.0
1824
- Added ${APPSTREAM_CHANGELOG_XML} to app.metainfo.xml
1925
- Added ${APPSTREAM_DESCRIPTION_XML} to app.metainfo.xml
2026
- Other minor corrections and changes
2127
- This line is deliberate test of escaping XML <>/" characters
2228

29+
2330
+ Version 1.0.2; 2023-04-18
2431
- The pupnet.conf file upgraded to version 1.3.0
2532
- Now builds using .NET6, rather than .NET7 (you can change this in csproj file if needed)
2633
- Reinstated key-press to exit on all deployments
2734

35+
2836
+ Version 1.0.1; 2023-03-26
2937
- Programs now asks for key-press only on Windows
3038
- Reports version correctly as 1.0.1
3139

40+
3241
+ Version 1.0.0; 2023-03-22
3342
- Initial release
3443
- Reports version as "3.2.1". This was intentional at the time by way of demonstration.

CONTRIBUTING

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ISSUES & IDEAS
2+
3+
Please do raise issues or share ideas. By raising an issue or sharing an idea, please note that you
4+
give your full permission to the project owner to implement them.
5+
6+
7+
PULL REQUESTS
8+
9+
By submitting a pull request for this project, you agree to assign your copyright of the
10+
contribution to the project owner (merged with or without minor changes). You assert that you have
11+
full power to assign such copyright.
12+
13+
This would allow us to, for example, change the license of the project or to transfer the ownership
14+
of the project to someone else without your further consent. We require this so that we do not have
15+
to ask everyone who has ever contributed.
16+
17+
If you feel uncomfortable about this, please do not make a pull request.

HelloWorld.pupnet.conf

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# PUPNET DEPLOY: 1.4.0
2+
# PUPNET DEPLOY: 1.8.0
33
################################################################################
44

55
########################################
@@ -21,16 +21,17 @@ AppId = zone.kuiper.helloworld
2121
# brackets to denote package release, i.e. '1.2.3[1]'. Release refers to a change to the deployment
2222
# package, rather the application. If release part is absent (i.e. '1.2.3'), the release value defaults
2323
# to '1'. Note that the version-release value given here may be overridden from the command line.
24-
AppVersionRelease = 1.0.3[1]
24+
AppVersionRelease = 1.0.4[1]
2525

26-
# Mandatory single line application short summary description.
26+
# Mandatory single line application summary text in default (English) language.
2727
AppShortSummary = A Hello World application
2828

29-
# Optional multi-line (surround with triple """ quotes) application description which may provide
30-
# longer text than AppShortSummary. Text separated by an empty line will be treated as paragraphs
31-
# (complex formatting should be avoided). The content is used by package builders where supported,
32-
# including RPM and DEB, and may optionally be used to populate the '<description>' element in the
33-
# AppStream metadata through the use of a macro variable.
29+
# Multi-line (surround with triple """ quotes) application description which provides longer explanation
30+
# than AppShortSummary in default language. Optional but it is recommended to specify this. Text
31+
# separated by an empty line will be treated as separate paragraphs. Avoid complex formatting, and do not
32+
# use HTML or markdown, other than list items begining with "* ", "+ " or "- ". This content is
33+
# used by package builders where supported, including RPM and DEB, and is used to populate the
34+
# ${APPSTREAM_DESCRIPTION_XML} element used within AppStream metadata.
3435
AppDescription = """
3536
Hello World demonstrates all the major features of building distributable packages with PupNet.
3637
It can be built for all package kinds, including AppImage, Flatpak, DEB and RPM formats on Linux,
@@ -42,7 +43,7 @@ AppDescription = """
4243
through the build system, to the application.
4344
"""
4445

45-
# Mandatory application license ID. This should be one of the recognised SPDX license
46+
# Mandatory application license ID. This should be one of the recognized SPDX license
4647
# identifiers, such as: 'MIT', 'GPL-3.0-or-later' or 'Apache-2.0'. For a proprietary or
4748
# custom license, use 'LicenseRef-Proprietary' or 'LicenseRef-LICENSE'.
4849
AppLicenseId = GPL-3.0-or-later
@@ -54,10 +55,9 @@ AppLicenseFile = LICENSE
5455
# Optional path to application changelog file. IMPORTANT. If given, this file should contain version
5556
# information in a predefined format. Namely, it should contain one or more version headings of form:
5657
# '+ VERSION;DATE', under which are to be listed change items of form: '- Change description'. Formatted
57-
# information will be parsed and used to populate AppStream metadata. Additionally, it will be packaged
58-
# with the application and used with package builders where supported. NOTE. Superfluous text in the file
59-
# is ignored, so the file may also contain README information.
60-
# For information: https://github.com/kuiperzone/PupNet-Deploy.
58+
# information will be parsed and used to expand the ${APPSTREAM_CHANGELOG_XML} macro used
59+
# for AppStream metadata (superfluous text is ignored, so the file may also contain README information).
60+
# The given file will also be packaged with the application verbatim. See: https://github.com/kuiperzone/PupNet-Deploy.
6161
AppChangeFile = CHANGES
6262

6363
########################################
@@ -68,15 +68,16 @@ AppChangeFile = CHANGES
6868
PublisherName = Kuiper Zone
6969

7070
# Optional copyright statement.
71-
PublisherCopyright = Copyright (C) Kuiper 2023
71+
PublisherCopyright = Copyright (C) Kuiper 2024
7272

7373
# Optional publisher or application web-link name. Note that Windows Setup packages
7474
# require both PublisherLinkName and PublisherLinkUrl in order to include the link as
7575
# an item in program menu entries. Do not modify name, as may leave old entries in updated installations.
7676
PublisherLinkName = Home Page
7777

78-
# Optional publisher or application web-link URL.
79-
PublisherLinkUrl = https://kuiper.zone
78+
# Publisher or application web-link URL. Although optional, it should be considered mandatory if using
79+
# MetaFile
80+
PublisherLinkUrl = https://github.com/kuiperzone
8081

8182
# Publisher or maintainer email contact. Although optional, some package builders (i.e. DEB) require it
8283
# and may warn or fail unless provided.
@@ -111,7 +112,7 @@ DesktopFile = Deploy/app.desktop
111112
# supported for all packages kinds (i.e. Flatpak). Default is empty (none).
112113
StartCommand = helloworld
113114

114-
# Optional category for the application. The value should be one of the recognised Freedesktop top-level
115+
# Optional category for the application. The value should be one of the recognized Freedesktop top-level
115116
# categories, such as: Audio, Development, Game, Office, Utility etc. Only a single value should be
116117
# provided here which will be used, where supported, to populate metadata. The default is empty.
117118
# See: https://specifications.freedesktop.org/menu-spec/latest/apa.html
@@ -140,11 +141,11 @@ IconFiles = """
140141
# DOTNET PUBLISH
141142
########################################
142143

143-
# Optional path relative to this file in which to find the dotnet project (.csproj) or solution (.sln)
144-
# file, or the directory containing it. If empty (default), a single project or solution file is
145-
# expected under the same directory as this file. IMPORTANT. If set to 'NONE', dotnet publish
146-
# is disabled (not called). Instead, only DotnetPostPublish is called.
147-
DotnetProjectPath =
144+
# Optional path relative to this file in which to find the dotnet project (.csproj) file, or the
145+
# directory containing it. If empty (default), a single project file is expected under the same
146+
# directory as this file. IMPORTANT. If set to 'NONE', dotnet publish is disabled
147+
# (i.e. not called). Instead, only DotnetPostPublish is called.
148+
DotnetProjectPath = HelloWorld
148149

149150
# Optional arguments supplied to 'dotnet publish'. Do NOT include '-r' (runtime), or '-c' (configuration)
150151
# here as they will be added according to command line arguments. Typically you want as a minimum:
@@ -209,7 +210,7 @@ FlatpakPlatformSdk = org.freedesktop.Sdk
209210

210211
# The platform runtime version. The latest available version may change periodically.
211212
# Refer to Flatpak documentation.
212-
FlatpakPlatformVersion = 22.08
213+
FlatpakPlatformVersion = 23.08
213214

214215
# Flatpak manifest 'finish-args' sandbox permissions. Optional, but if empty, the application will have
215216
# extremely limited access to the host environment. This option may be used to grant required
@@ -276,6 +277,12 @@ DebianRecommends = """
276277
# WINDOWS SETUP OPTIONS
277278
########################################
278279

280+
# Optional application group name used as the Start Menu folder and install directory under Program Files.
281+
# Specifically, it is used to define the InnoSetup DefaultGroupName and DefaultDirName parameters.
282+
# If empty (default), suitable values are used based on your application.
283+
# See: https://jrsoftware.org/ishelp/index.php?topic=setup_defaultgroupname
284+
SetupGroupName = Hello World Demo
285+
279286
# Boolean (true or false) which specifies whether the application is to be installed in administrative
280287
# mode, or per-user. Default is false. See: https://jrsoftware.org/ishelp/topic_admininstallmode.htm
281288
SetupAdminInstall = false

HelloWorld/HelloWorld.csproj

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

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88

HelloWorld/Program.cs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// -----------------------------------------------------------------------------
22
// PROJECT : PupNet
3-
// COPYRIGHT : Andy Thomas (C) 2022-23
3+
// COPYRIGHT : Andy Thomas (C) 2022-24
44
// LICENSE : GPL-3.0-or-later
55
// HOMEPAGE : https://github.com/kuiperzone/PupNet
66
//
@@ -16,10 +16,7 @@
1616
// with PupNet. If not, see <https://www.gnu.org/licenses/>.
1717
// -----------------------------------------------------------------------------
1818

19-
using System;
20-
using System.IO;
2119
using System.Reflection;
22-
using System.Runtime.InteropServices;
2320

2421
namespace HelloWorld
2522
{
@@ -50,21 +47,33 @@ static void Main(string[] args)
5047
Console.WriteLine("Assembly.GetEntryAssembly().Location: {0}", Assembly.GetEntryAssembly()?.Location ?? "null");
5148
Console.WriteLine();
5249

53-
// Look for sub-directory created by DotnetPostPublish - ensures custom content is packaged
50+
51+
// Look for sub-directory created by DotnetPostPublish conf parameter
52+
// This ensures custom content is packaged.
53+
Console.WriteLine("POST PUBLISH");
5454
dir = Path.Combine(dir, "subdir");
5555
Console.WriteLine("Packaged subdir exists: " + Directory.Exists(dir));
5656
Console.WriteLine("Packaged subdir/file.test exists: " + File.Exists(Path.Combine(dir, "file.test")));
57-
Console.WriteLine("If the above is 'True', it indicates the PostPublish build script was run during the build");
58-
Console.WriteLine();
57+
Console.WriteLine("If the above is 'True', it indicates the DotnetPostPublish script was run during the build");
5958

60-
#if CUSTOM_FLAG
61-
// Test for passing property from command line
62-
// NOTE. In some case, you might have to do a clean first
63-
Console.WriteLine("CUSTOM_FLAG defined OK");
64-
Console.WriteLine("pupnet was called with: --property DefineConstants=CUSTOM_FLAG");
59+
60+
// Test for passing property from command line when publishing project
61+
Console.WriteLine();
62+
Console.WriteLine("PUBLISH PROPERTIES");
63+
#if FLAG1
64+
Console.WriteLine("FLAG1 defined OK!!!");
65+
Console.WriteLine("pupnet was called with: --property DefineConstants=FLAG1");
66+
#else
67+
Console.WriteLine("FLAG1 NOT defined");
68+
Console.WriteLine("pupnet was NOT called with: --property DefineConstants=FLAG1");
69+
#endif
70+
Console.WriteLine();
71+
#if FLAG2
72+
Console.WriteLine("FLAG2 defined OK!!!");
73+
Console.WriteLine("pupnet was called with: --property DefineConstants=FLAG2");
6574
#else
66-
Console.WriteLine("CUSTOM_FLAG NOT defined");
67-
Console.WriteLine("pupnet was NOT called with: --property DefineConstants=CUSTOM_FLAG");
75+
Console.WriteLine("FLAG2 NOT defined");
76+
Console.WriteLine("pupnet was NOT called with: --property DefineConstants=FLAG2");
6877
#endif
6978

7079
Console.WriteLine();

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,52 @@ the build system, to the application.
3636

3737
Clone this repository to your local drive.
3838

39-
Install [PupNet Deploy](https://github.com/kuiperzone/PupNet-Deploy), along with it's prerequisites.
39+
Install [PupNet Deploy](https://github.com/kuiperzone/PupNet-Deploy), along with its prerequisites.
4040

41-
At the solution directory, under Linux:
41+
### Under Linux ###
4242

43-
pupnet -k appimage
43+
At the solution directory:
44+
45+
pupnet --kind appimage
4446

4547
pupnet -k flatpak
4648

4749
pupnet -k deb
4850

4951
pupnet -k rpm
5052

51-
Under Windows:
53+
The package output kind defaults to `appimage` if omitted under Linux.
54+
55+
### Under Windows ###
56+
57+
At the solution directory:
5258

5359
pupnet -k setup
5460

55-
To test specifying a custom flag:
61+
It defaults to `setup` if omitted under Windows.
62+
63+
## RUNNING THE APP ##
64+
The application runs in the terminal, so run the program from the command-line rather than double-clicking from
65+
a file manager to see the output.
5666

57-
pupnet -k appimage --property DefineConstants=CUSTOM_FLAG
67+
## BUILD WITH PROPERTIES ##
68+
The program prints different output according to whether the `#FLAG1` and `#FLAG2` macros are defined.
69+
This is intended to test that we can successfully pass properties during the pupnet build.
5870

59-
This builds the program with the `#CUSTOM_FLAG` predefined macro. In this case, the Hello World program will output the
60-
following when built, installed and ran:
71+
To test set both flags at command line:
72+
73+
pupnet --property DefineConstants=FLAG1,FLAG2
74+
75+
Use a comma (not semi-colon) and do not put a space between the values.
76+
77+
In this case, the Hello World program will output the following when built and run:
6178

6279
CUSTOM_FLAG defined OK
6380
pupnet was called with: --property DefineConstants=CUSTOM_FLAG;
6481

65-
The application runs in the terminal, so run the program from the command-line rather than double-clicking from
66-
a file manager to see the output.
6782

6883
See the [PupNet Deploy Project](https://github.com/kuiperzone/PupNet-Deploy) for complete instructions and information.
6984

7085
**PupNet Deploy** was created by Andy Thomas at [https://kuiper.zone](https://kuiper.zone).
7186

72-
If you like this project, don't forget to like and share.
87+
If you like this project, don't forget to like and share.

clean.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)