diff --git a/CHANGES b/CHANGES index 25487b5..b4e5d61 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,12 @@ using the ${APPSTREAM_CHANGELOG_XML} macro. This means the version changes need The changelog parser should do a robust job at parsing version information while ignoring superfluous README text (such as this), but care should be taken to ensure that version information is correctly formatted. ++ Version 1.0.4; 2024-03-18 +- Updated for pupnet 1.8.0. +- Add multiple checks for DefineConstants. +- Project file updated to .NET8. + + + Version 1.0.3; 2023-05-04 - The pupnet.conf file upgraded to version 1.4.0 - Added ${APPSTREAM_CHANGELOG_XML} to app.metainfo.xml @@ -20,15 +26,18 @@ The changelog parser should do a robust job at parsing version information while - Other minor corrections and changes - This line is deliberate test of escaping XML <>/" characters + + Version 1.0.2; 2023-04-18 - The pupnet.conf file upgraded to version 1.3.0 - Now builds using .NET6, rather than .NET7 (you can change this in csproj file if needed) - Reinstated key-press to exit on all deployments + + Version 1.0.1; 2023-03-26 - Programs now asks for key-press only on Windows - Reports version correctly as 1.0.1 + + Version 1.0.0; 2023-03-22 - Initial release - Reports version as "3.2.1". This was intentional at the time by way of demonstration. diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..396349a --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,17 @@ +ISSUES & IDEAS + +Please do raise issues or share ideas. By raising an issue or sharing an idea, please note that you +give your full permission to the project owner to implement them. + + +PULL REQUESTS + +By submitting a pull request for this project, you agree to assign your copyright of the +contribution to the project owner (merged with or without minor changes). You assert that you have +full power to assign such copyright. + +This would allow us to, for example, change the license of the project or to transfer the ownership +of the project to someone else without your further consent. We require this so that we do not have +to ask everyone who has ever contributed. + +If you feel uncomfortable about this, please do not make a pull request. \ No newline at end of file diff --git a/HelloWorld.pupnet.conf b/HelloWorld.pupnet.conf index e36ba1b..23a29d6 100644 --- a/HelloWorld.pupnet.conf +++ b/HelloWorld.pupnet.conf @@ -1,5 +1,5 @@ ################################################################################ -# PUPNET DEPLOY: 1.4.0 +# PUPNET DEPLOY: 1.8.0 ################################################################################ ######################################## @@ -21,16 +21,17 @@ AppId = zone.kuiper.helloworld # brackets to denote package release, i.e. '1.2.3[1]'. Release refers to a change to the deployment # package, rather the application. If release part is absent (i.e. '1.2.3'), the release value defaults # to '1'. Note that the version-release value given here may be overridden from the command line. -AppVersionRelease = 1.0.3[1] +AppVersionRelease = 1.0.4[1] -# Mandatory single line application short summary description. +# Mandatory single line application summary text in default (English) language. AppShortSummary = A Hello World application -# Optional multi-line (surround with triple """ quotes) application description which may provide -# longer text than AppShortSummary. Text separated by an empty line will be treated as paragraphs -# (complex formatting should be avoided). The content is used by package builders where supported, -# including RPM and DEB, and may optionally be used to populate the '' element in the -# AppStream metadata through the use of a macro variable. +# Multi-line (surround with triple """ quotes) application description which provides longer explanation +# than AppShortSummary in default language. Optional but it is recommended to specify this. Text +# separated by an empty line will be treated as separate paragraphs. Avoid complex formatting, and do not +# use HTML or markdown, other than list items begining with "* ", "+ " or "- ". This content is +# used by package builders where supported, including RPM and DEB, and is used to populate the +# ${APPSTREAM_DESCRIPTION_XML} element used within AppStream metadata. AppDescription = """ Hello World demonstrates all the major features of building distributable packages with PupNet. It can be built for all package kinds, including AppImage, Flatpak, DEB and RPM formats on Linux, @@ -42,7 +43,7 @@ AppDescription = """ through the build system, to the application. """ -# Mandatory application license ID. This should be one of the recognised SPDX license +# Mandatory application license ID. This should be one of the recognized SPDX license # identifiers, such as: 'MIT', 'GPL-3.0-or-later' or 'Apache-2.0'. For a proprietary or # custom license, use 'LicenseRef-Proprietary' or 'LicenseRef-LICENSE'. AppLicenseId = GPL-3.0-or-later @@ -54,10 +55,9 @@ AppLicenseFile = LICENSE # Optional path to application changelog file. IMPORTANT. If given, this file should contain version # information in a predefined format. Namely, it should contain one or more version headings of form: # '+ VERSION;DATE', under which are to be listed change items of form: '- Change description'. Formatted -# information will be parsed and used to populate AppStream metadata. Additionally, it will be packaged -# with the application and used with package builders where supported. NOTE. Superfluous text in the file -# is ignored, so the file may also contain README information. -# For information: https://github.com/kuiperzone/PupNet-Deploy. +# information will be parsed and used to expand the ${APPSTREAM_CHANGELOG_XML} macro used +# for AppStream metadata (superfluous text is ignored, so the file may also contain README information). +# The given file will also be packaged with the application verbatim. See: https://github.com/kuiperzone/PupNet-Deploy. AppChangeFile = CHANGES ######################################## @@ -68,15 +68,16 @@ AppChangeFile = CHANGES PublisherName = Kuiper Zone # Optional copyright statement. -PublisherCopyright = Copyright (C) Kuiper 2023 +PublisherCopyright = Copyright (C) Kuiper 2024 # Optional publisher or application web-link name. Note that Windows Setup packages # require both PublisherLinkName and PublisherLinkUrl in order to include the link as # an item in program menu entries. Do not modify name, as may leave old entries in updated installations. PublisherLinkName = Home Page -# Optional publisher or application web-link URL. -PublisherLinkUrl = https://kuiper.zone +# Publisher or application web-link URL. Although optional, it should be considered mandatory if using +# MetaFile +PublisherLinkUrl = https://github.com/kuiperzone # Publisher or maintainer email contact. Although optional, some package builders (i.e. DEB) require it # and may warn or fail unless provided. @@ -111,7 +112,7 @@ DesktopFile = Deploy/app.desktop # supported for all packages kinds (i.e. Flatpak). Default is empty (none). StartCommand = helloworld -# Optional category for the application. The value should be one of the recognised Freedesktop top-level +# Optional category for the application. The value should be one of the recognized Freedesktop top-level # categories, such as: Audio, Development, Game, Office, Utility etc. Only a single value should be # provided here which will be used, where supported, to populate metadata. The default is empty. # See: https://specifications.freedesktop.org/menu-spec/latest/apa.html @@ -140,11 +141,11 @@ IconFiles = """ # DOTNET PUBLISH ######################################## -# Optional path relative to this file in which to find the dotnet project (.csproj) or solution (.sln) -# file, or the directory containing it. If empty (default), a single project or solution file is -# expected under the same directory as this file. IMPORTANT. If set to 'NONE', dotnet publish -# is disabled (not called). Instead, only DotnetPostPublish is called. -DotnetProjectPath = +# Optional path relative to this file in which to find the dotnet project (.csproj) file, or the +# directory containing it. If empty (default), a single project file is expected under the same +# directory as this file. IMPORTANT. If set to 'NONE', dotnet publish is disabled +# (i.e. not called). Instead, only DotnetPostPublish is called. +DotnetProjectPath = HelloWorld # Optional arguments supplied to 'dotnet publish'. Do NOT include '-r' (runtime), or '-c' (configuration) # 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 # The platform runtime version. The latest available version may change periodically. # Refer to Flatpak documentation. -FlatpakPlatformVersion = 22.08 +FlatpakPlatformVersion = 23.08 # Flatpak manifest 'finish-args' sandbox permissions. Optional, but if empty, the application will have # extremely limited access to the host environment. This option may be used to grant required @@ -276,6 +277,12 @@ DebianRecommends = """ # WINDOWS SETUP OPTIONS ######################################## +# Optional application group name used as the Start Menu folder and install directory under Program Files. +# Specifically, it is used to define the InnoSetup DefaultGroupName and DefaultDirName parameters. +# If empty (default), suitable values are used based on your application. +# See: https://jrsoftware.org/ishelp/index.php?topic=setup_defaultgroupname +SetupGroupName = Hello World Demo + # Boolean (true or false) which specifies whether the application is to be installed in administrative # mode, or per-user. Default is false. See: https://jrsoftware.org/ishelp/topic_admininstallmode.htm SetupAdminInstall = false diff --git a/HelloWorld/HelloWorld.csproj b/HelloWorld/HelloWorld.csproj index 7c5ecf1..8ee7fed 100644 --- a/HelloWorld/HelloWorld.csproj +++ b/HelloWorld/HelloWorld.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable enable diff --git a/HelloWorld/Program.cs b/HelloWorld/Program.cs index 3071b7d..03f51ab 100644 --- a/HelloWorld/Program.cs +++ b/HelloWorld/Program.cs @@ -1,6 +1,6 @@ // ----------------------------------------------------------------------------- // PROJECT : PupNet -// COPYRIGHT : Andy Thomas (C) 2022-23 +// COPYRIGHT : Andy Thomas (C) 2022-24 // LICENSE : GPL-3.0-or-later // HOMEPAGE : https://github.com/kuiperzone/PupNet // @@ -16,10 +16,7 @@ // with PupNet. If not, see . // ----------------------------------------------------------------------------- -using System; -using System.IO; using System.Reflection; -using System.Runtime.InteropServices; namespace HelloWorld { @@ -50,21 +47,33 @@ static void Main(string[] args) Console.WriteLine("Assembly.GetEntryAssembly().Location: {0}", Assembly.GetEntryAssembly()?.Location ?? "null"); Console.WriteLine(); - // Look for sub-directory created by DotnetPostPublish - ensures custom content is packaged + + // Look for sub-directory created by DotnetPostPublish conf parameter + // This ensures custom content is packaged. + Console.WriteLine("POST PUBLISH"); dir = Path.Combine(dir, "subdir"); Console.WriteLine("Packaged subdir exists: " + Directory.Exists(dir)); Console.WriteLine("Packaged subdir/file.test exists: " + File.Exists(Path.Combine(dir, "file.test"))); - Console.WriteLine("If the above is 'True', it indicates the PostPublish build script was run during the build"); - Console.WriteLine(); + Console.WriteLine("If the above is 'True', it indicates the DotnetPostPublish script was run during the build"); -#if CUSTOM_FLAG - // Test for passing property from command line - // NOTE. In some case, you might have to do a clean first - Console.WriteLine("CUSTOM_FLAG defined OK"); - Console.WriteLine("pupnet was called with: --property DefineConstants=CUSTOM_FLAG"); + + // Test for passing property from command line when publishing project + Console.WriteLine(); + Console.WriteLine("PUBLISH PROPERTIES"); +#if FLAG1 + Console.WriteLine("FLAG1 defined OK!!!"); + Console.WriteLine("pupnet was called with: --property DefineConstants=FLAG1"); +#else + Console.WriteLine("FLAG1 NOT defined"); + Console.WriteLine("pupnet was NOT called with: --property DefineConstants=FLAG1"); +#endif + Console.WriteLine(); +#if FLAG2 + Console.WriteLine("FLAG2 defined OK!!!"); + Console.WriteLine("pupnet was called with: --property DefineConstants=FLAG2"); #else - Console.WriteLine("CUSTOM_FLAG NOT defined"); - Console.WriteLine("pupnet was NOT called with: --property DefineConstants=CUSTOM_FLAG"); + Console.WriteLine("FLAG2 NOT defined"); + Console.WriteLine("pupnet was NOT called with: --property DefineConstants=FLAG2"); #endif Console.WriteLine(); diff --git a/README.md b/README.md index bc1ab32..5f85f80 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,13 @@ the build system, to the application. Clone this repository to your local drive. -Install [PupNet Deploy](https://github.com/kuiperzone/PupNet-Deploy), along with it's prerequisites. +Install [PupNet Deploy](https://github.com/kuiperzone/PupNet-Deploy), along with its prerequisites. -At the solution directory, under Linux: +### Under Linux ### - pupnet -k appimage +At the solution directory: + + pupnet --kind appimage pupnet -k flatpak @@ -48,25 +50,38 @@ At the solution directory, under Linux: pupnet -k rpm -Under Windows: +The package output kind defaults to `appimage` if omitted under Linux. + +### Under Windows ### + +At the solution directory: pupnet -k setup -To test specifying a custom flag: +It defaults to `setup` if omitted under Windows. + +## RUNNING THE APP ## +The application runs in the terminal, so run the program from the command-line rather than double-clicking from +a file manager to see the output. - pupnet -k appimage --property DefineConstants=CUSTOM_FLAG +## BUILD WITH PROPERTIES ## +The program prints different output according to whether the `#FLAG1` and `#FLAG2` macros are defined. +This is intended to test that we can successfully pass properties during the pupnet build. -This builds the program with the `#CUSTOM_FLAG` predefined macro. In this case, the Hello World program will output the -following when built, installed and ran: +To test set both flags at command line: + + pupnet --property DefineConstants=FLAG1,FLAG2 + +Use a comma (not semi-colon) and do not put a space between the values. + +In this case, the Hello World program will output the following when built and run: CUSTOM_FLAG defined OK pupnet was called with: --property DefineConstants=CUSTOM_FLAG; -The application runs in the terminal, so run the program from the command-line rather than double-clicking from -a file manager to see the output. See the [PupNet Deploy Project](https://github.com/kuiperzone/PupNet-Deploy) for complete instructions and information. **PupNet Deploy** was created by Andy Thomas at [https://kuiper.zone](https://kuiper.zone). -If you like this project, don't forget to like and share. \ No newline at end of file +If you like this project, don't forget to like and share. diff --git a/clean.sh b/clean.sh deleted file mode 100755 index 41a673c..0000000 --- a/clean.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -find . -iname "bin" | xargs rm -rf -find . -iname "obj" | xargs rm -rf - -rm -rf ./Publish/* \ No newline at end of file