Skip to content

Commit

Permalink
Update paths and add workflow file to build native launchers.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcsmith-net committed Dec 21, 2023
1 parent df96b9b commit b8e969a
Show file tree
Hide file tree
Showing 13 changed files with 244 additions and 34 deletions.
210 changes: 210 additions & 0 deletions .github/workflows/native-binary-build-launcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# ----------------------
#
# This workflow builds the native Windows launchers for the IDE and platform.
#
# The result of the build are files 'launcher-external-sources.zip'
# and 'launcher-external-binaries.zip' which can be downloaded from
# the GitHub Actions UI and prepared for release to be used by the Ant build
# scripts for the NetBeans distribution.
#
# ----------------------


name: NetBeans Native Launcher


on:
push:
# Triggers the workflow on push or pull request events but only for
# relevant paths
paths:
- .github/workflows/native-binary-build-launcher.y*
- platform/o.n.bootstrap/launcher/windows/**
- harness/apisupport.harness/windows-launcher-src/**
- nb/ide.launcher/windows/**

pull_request:
paths:
- .github/workflows/native-binary-build-launcher.y*
- platform/o.n.bootstrap/launcher/windows/**
- harness/apisupport.harness/windows-launcher-src/**
- nb/ide.launcher/windows/**

# Allows you to run this workflow manually from the Actions tab in GitHub UI
workflow_dispatch:

# cancel other PR workflow run in the same head-base group if it exists (e.g. during PR syncs)
# if this is not a PR run (no github.head_ref and github.base_ref defined), use an UID as group
concurrency:
group: launcher-${{ github.head_ref || github.run_id }}-${{ github.base_ref }}
cancel-in-progress: true

jobs:

source:

name: Package Sources
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: false
show-progress: false

- name: Generate source bundle
run: |
SOURCES="nbbuild/build/native/launcher/sources"
mkdir -p ${SOURCES}/platform/o.n.bootstrap/launcher/
cp -r platform/o.n.bootstrap/launcher/windows/ ${SOURCES}/platform/o.n.bootstrap/launcher/
mkdir -p ${SOURCES}/harness/apisupport.harness/
cp -r harness/apisupport.harness/windows-launcher-src/ ${SOURCES}/harness/apisupport.harness/
mkdir -p ${SOURCES}/nb/ide.launcher/
cp -r nb/ide.launcher/windows/ ${SOURCES}/nb/ide.launcher/
cp LICENSE ${SOURCES}/LICENSE
cp NOTICE ${SOURCES}/NOTICE
ls -l -R ${SOURCES}
- name: Upload native sources
uses: actions/upload-artifact@v3
with:
name: launcher-external-sources
path: nbbuild/build/native/launcher/sources/
if-no-files-found: error


build-linux:

name: Build with MinGW
runs-on: ubuntu-latest
needs: source

steps:

- name: Install MinGW
run: sudo apt install mingw-w64 mingw-w64-tools

- name: Download sources
uses: actions/download-artifact@v3
with:
name: launcher-external-sources

- name: Build bootstrap binaries
run: |
echo "Building bootstrap binaries"
rm -rf ./build/
make -f Makefile.mingw
ls -l -R ./build/
echo "done"
working-directory: platform/o.n.bootstrap/launcher/windows/

- name: Upload bootstrap artifacts
uses: actions/upload-artifact@v3
with:
name: launcher-bootstrap-bin
path: platform/o.n.bootstrap/launcher/windows/build/
if-no-files-found: error

- name: Build harness binaries
run: |
echo "Building harness binaries"
rm -rf ./build/
make -f Makefile.mingw
ls -l -R ./build/
echo "done"
working-directory: harness/apisupport.harness/windows-launcher-src

- name: Upload harness artifacts
uses: actions/upload-artifact@v3
with:
name: launcher-harness-bin
path: harness/apisupport.harness/windows-launcher-src/build/
if-no-files-found: error

- name: Build IDE binaries
run: |
echo "Building IDE binaries"
rm -rf ./build/
make -f Makefile.mingw
ls -l -R ./build/
echo "done"
working-directory: nb/ide.launcher/windows

- name: Upload IDE artifacts
uses: actions/upload-artifact@v3
with:
name: launcher-ide-bin
path: nb/ide.launcher/windows/build/
if-no-files-found: error

build-zip-with-build-artifacts:

name: Package Binaries
runs-on: ubuntu-latest

# Only run when the platform specific builds are finished
needs: [build-linux]

steps:

- name: Create dir structure
run: mkdir -p myfiles/

- name: Download artifacts from predecessor jobs
uses: actions/download-artifact@v3
with:
path: myfiles/

- name: Tidy up and display artifacts
run: |
cp myfiles/launcher-external-sources/LICENSE myfiles/LICENSE
cp myfiles/launcher-external-sources/NOTICE myfiles/NOTICE
cp myfiles/*bin/*.exe myfiles/
cp myfiles/*bin/*.dll myfiles/
rm -rf myfiles/*-sources/
rm -rf myfiles/*-bin/
ls -l -R
- name: Create BUILDINFO
run: |
BUILDINFO="myfiles/BUILDINFO.txt"
touch "$BUILDINFO"
echo "Apache NetBeans" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
echo "Binaries in this ZIP are..." >> "$BUILDINFO"
echo "Build by GitHub Actions Workflow: ${GITHUB_WORKFLOW}" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
echo "Build from:" >> "$BUILDINFO"
echo " Git repo : ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> "$BUILDINFO"
echo " Git commit SHA : ${GITHUB_SHA}" >> "$BUILDINFO"
echo " Git ref : ${GITHUB_REF}" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
echo "Build time UTC : $(date --rfc-3339=seconds --utc)" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
- name: Upload bundle
uses: actions/upload-artifact@v3
with:
name: launcher-external-binaries
path: myfiles/
if-no-files-found: error
12 changes: 6 additions & 6 deletions harness/apisupport.harness/windows-launcher-src/Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.

TMPFLD = ../../../../target/tmp/
OFLD = ../../../../target/harness/
TMPFLD = ./build/
OFLD = ./build/

all: prepfolder app64.exe app.exe

Expand All @@ -30,12 +30,12 @@ clean:
app64.res: app.rc app.exe.manifest
x86_64-w64-mingw32-windres -o$(TMPFLD)app64.res -Ocoff -DMANIFEST_FILE=app.exe.manifest app.rc

app64.exe: app.cpp applauncher.cpp app64.res ../bootstrap/utilsfuncs.cpp
x86_64-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec64.dll"' -DARCHITECTURE=64 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh app.cpp -mwindows applauncher.cpp $(TMPFLD)app64.res ../bootstrap/utilsfuncs.cpp ../ide/nblauncher.cpp -I ../bootstrap/ -o$(OFLD)app64.exe -static -lstdc++ -static-libstdc++ -static-libgcc
app64.exe: app.cpp applauncher.cpp app64.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp
x86_64-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec64.dll"' -DARCHITECTURE=64 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh app.cpp -mwindows applauncher.cpp $(TMPFLD)app64.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp ../../../nb/ide.launcher/windows/nblauncher.cpp -I ../../../platform/o.n.bootstrap/launcher/windows/ -o$(OFLD)app64.exe -static -lstdc++ -static-libstdc++ -static-libgcc

app.res: app.rc app.exe.manifest
i686-w64-mingw32-windres -o$(TMPFLD)app.res -Ocoff -DMANIFEST_FILE=app.exe.manifest app.rc

app.exe: app.cpp applauncher.cpp app.res ../bootstrap/utilsfuncs.cpp
i686-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec.dll"' -DARCHITECTURE=32 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh -mwindows app.cpp applauncher.cpp $(TMPFLD)app.res ../bootstrap/utilsfuncs.cpp ../ide/nblauncher.cpp -I ../bootstrap/ -o$(OFLD)app.exe -static -lstdc++ -static-libstdc++ -static-libgcc
app.exe: app.cpp applauncher.cpp app.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp
i686-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec.dll"' -DARCHITECTURE=32 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh -mwindows app.cpp applauncher.cpp $(TMPFLD)app.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp ../../../nb/ide.launcher/windows/nblauncher.cpp -I ../../../platform/o.n.bootstrap/launcher/windows/ -o$(OFLD)app.exe -static -lstdc++ -static-libstdc++ -static-libgcc

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="9.0.0.0"
<assemblyIdentity version="101.1.0.0"
processorArchitecture="x86"
name="app.exe"
type="win32"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/

#include "applauncher.h"
#include "../bootstrap/utilsfuncs.h"
#include "../bootstrap/argnames.h"
#include "../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.h"
#include "../../../platform/o.n.bootstrap/launcher/windows/argnames.h"

using namespace std;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <windows.h>

#include "shlobj.h"
#include "../ide/nblauncher.h"
#include "../../../nb/ide.launcher/windows/nblauncher.h"

class AppLauncher : public NbLauncher {

Expand Down
12 changes: 6 additions & 6 deletions nb/ide.launcher/windows/Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.

TMPFLD = ../../../../target/tmp/
OFLD = ../../../../target/ide/
TMPFLD = ./build/
OFLD = ./build/

all: prepfolder netbeans64.exe netbeans.exe

Expand All @@ -30,11 +30,11 @@ clean:
netbeans64.res: netbeans.rc netbeans64.exe.manifest
x86_64-w64-mingw32-windres -o$(TMPFLD)netbeans64.res -Ocoff -DMANIFEST_FILE=netbeans64.exe.manifest netbeans.rc

netbeans64.exe: netbeans.cpp nblauncher.cpp netbeans64.res ../bootstrap/utilsfuncs.cpp
x86_64-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec64.dll"' -DARCHITECTURE=64 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh -mwindows netbeans.cpp nblauncher.cpp $(TMPFLD)netbeans64.res ../bootstrap/utilsfuncs.cpp -I ../bootstrap/ -o$(OFLD)netbeans64.exe -static -lstdc++ -static-libstdc++ -static-libgcc
netbeans64.exe: netbeans.cpp nblauncher.cpp netbeans64.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp
x86_64-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec64.dll"' -DARCHITECTURE=64 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh -mwindows netbeans.cpp nblauncher.cpp $(TMPFLD)netbeans64.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp -I ../../../platform/o.n.bootstrap/launcher/windows/ -o$(OFLD)netbeans64.exe -static -lstdc++ -static-libstdc++ -static-libgcc

netbeans.res: netbeans.rc netbeans.exe.manifest
i686-w64-mingw32-windres -o$(TMPFLD)netbeans.res -Ocoff -DMANIFEST_FILE=netbeans.exe.manifest netbeans.rc

netbeans.exe: netbeans.cpp nblauncher.cpp netbeans.res ../bootstrap/utilsfuncs.cpp
i686-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec.dll"' -DARCHITECTURE=32 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh -mwindows netbeans.cpp nblauncher.cpp $(TMPFLD)netbeans.res ../bootstrap/utilsfuncs.cpp -I ../bootstrap/ -o$(OFLD)netbeans.exe -static -lstdc++ -static-libstdc++ -static-libgcc
netbeans.exe: netbeans.cpp nblauncher.cpp netbeans.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp
i686-w64-mingw32-gcc -s -DNBEXEC_DLL='"/lib/nbexec.dll"' -DARCHITECTURE=32 -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-seh -mwindows netbeans.cpp nblauncher.cpp $(TMPFLD)netbeans.res ../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.cpp -I ../../../platform/o.n.bootstrap/launcher/windows/ -o$(OFLD)netbeans.exe -static -lstdc++ -static-libstdc++ -static-libgcc
6 changes: 3 additions & 3 deletions nb/ide.launcher/windows/nblauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include <shlobj.h>
#include <winnls.h>
#include "nblauncher.h"
#include "../bootstrap/utilsfuncs.h"
#include "../bootstrap/argnames.h"
#include "../bootstrap/nbexecloader.h"
#include "../../../platform/o.n.bootstrap/launcher/windows/utilsfuncs.h"
#include "../../../platform/o.n.bootstrap/launcher/windows/argnames.h"
#include "../../../platform/o.n.bootstrap/launcher/windows/nbexecloader.h"

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion nb/ide.launcher/windows/netbeans.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="9.0.0.0"
<assemblyIdentity version="101.1.0.0"
processorArchitecture="x86"
name="netbeans.exe"
type="win32"/>
Expand Down
2 changes: 1 addition & 1 deletion nb/ide.launcher/windows/netbeans64.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- Use processorArchitecture="x86", which is the value used by the 64-bit
javaw.exe on Java 10.0.2 and Java 11ea. -->
<assemblyIdentity version="9.0.0.0"
<assemblyIdentity version="101.1.0.0"
processorArchitecture="x86"
name="netbeans64.exe"
type="win32"/>
Expand Down
10 changes: 5 additions & 5 deletions nb/ide.launcher/windows/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/

#define COMPANY ""
#define COMPONENT "NetBeans IDE"
#define VER "12.5.0.0"
#define FVER 12,5,0,0
#define BUILD_ID "28062021"
#define COMPONENT "Apache NetBeans IDE Launcher"
#define VER "101.1.0.0"
#define FVER 101,1,0,0
#define BUILD_ID "101100"
#define INTERNAL_NAME "netbeans"
#define COPYRIGHT "Based on Apache NetBeans from the Apache Software Foundation and is licensed under Apache License Version 2.0"
#define NAME "NetBeans IDE 12.5"
#define NAME "Apache NetBeans IDE Launcher"

4 changes: 2 additions & 2 deletions platform/o.n.bootstrap/launcher/windows/Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.

TMPFLD = ../../../../target/tmp/
OFLD = ../../../../target/bootstrap/
TMPFLD = ./build/
OFLD = ./build/

all: prepfolder nbexec64.dll nbexec64.exe nbexec.dll nbexec.exe

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="9.0.0.0"
<assemblyIdentity version="101.1.0.0"
processorArchitecture="X86"
name="nbexec.exe"
type="win32"/>
Expand Down
10 changes: 5 additions & 5 deletions platform/o.n.bootstrap/launcher/windows/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/

#define COMPANY ""
#define COMPONENT "NetBeans Platform Launcher"
#define VER "12.5.0.0"
#define FVER 12,5,0,0
#define BUILD_ID "28062021"
#define COMPONENT "Apache NetBeans Platform Launcher"
#define VER "101.1.0.0"
#define FVER 101,1,0,0
#define BUILD_ID "101100"
#define INTERNAL_NAME "nbexec"
#define COPYRIGHT "Based on Apache NetBeans from the Apache Software Foundation and is licensed under Apache License Version 2.0"
#define NAME "NetBeans Platform Launcher"
#define NAME "Apache NetBeans Platform Launcher"

0 comments on commit b8e969a

Please sign in to comment.