Skip to content

Commit 2728116

Browse files
authored
buildPG.sh updates (#338)
1 parent 6dfa480 commit 2728116

File tree

5 files changed

+54
-24
lines changed

5 files changed

+54
-24
lines changed

.github/workflows/build-macos.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ jobs:
2323
TARGET: ${{matrix.cfg.target}}
2424
steps:
2525
- uses: actions/checkout@v3
26+
- name: Cache OF
27+
id: cache-of
28+
uses: actions/cache@v3
29+
env:
30+
cache-name: cache-keep-of
31+
with:
32+
path: |
33+
/Users/runner/work/projectGenerator/openFrameworks/**
34+
key: ${{ runner.os }}-${{matrix.cfg.opt}}-${{ env.cache-name }}-${{ hashFiles('openFrameworks/**/*.cpp') }}
35+
restore-keys: |
36+
${{ runner.os }}-${{matrix.cfg.opt}}-${{ env.cache-name }}-
2637
- name: rm-dev
2738
run: sudo rm -rf /Library/Developer
2839
- name: Build

commandLine/Project.xcconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ OF_PATH = ../../..
55
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
66
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
77

8+
HEADER_OF = "$(OF_PATH)/libs/openFrameworks/{ofMain.h}"
9+
10+
11+
OF_CORE_LIBS = $(LIB_GLEW) $(LIB_PUGIXML)
12+
13+
OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_GLEW) $(HEADER_TESS2) $(HEADER_GLFW) $(HEADER_UTF8) $(HEADER_JSON) $(HEADER_GLM) $(HEADER_PUGIXML)
14+
15+
OF_CORE_FRAMEWORKS = -framework Accelerate -framework Cocoa -framework CoreFoundation -framework CoreServices -framework CoreVideo -framework IOKit -framework OpenGL -framework QuartzCore -framework Security
16+
817
//UNCOMMENT BELOW TO ENABLE C++ 17 and std::filesystem
918
CLANG_CXX_LANGUAGE_STANDARD = c++17
1019
MACOSX_DEPLOYMENT_TARGET = 10.15

commandLine/commandLine.xcodeproj/project.pbxproj

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -660,10 +660,9 @@
660660
isa = PBXNativeTarget;
661661
buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "commandLine" */;
662662
buildPhases = (
663-
E42962A92163ECCD00A6A9E2 /* ShellScript */,
663+
E42962A92163ECCD00A6A9E2 /* Run Script - Compile OF */,
664664
E4B69B580A3A1756003C02F2 /* Sources */,
665665
E4B69B590A3A1756003C02F2 /* Frameworks */,
666-
E4B6FFFD0C3F9AB9008CF71C /* ShellScript */,
667666
E4C2427710CC5ABF004149E2 /* CopyFiles */,
668667
928F60851B6710B200E2D791 /* ShellScript */,
669668
);
@@ -707,6 +706,7 @@
707706
/* Begin PBXShellScriptBuildPhase section */
708707
928F60851B6710B200E2D791 /* ShellScript */ = {
709708
isa = PBXShellScriptBuildPhase;
709+
alwaysOutOfDate = 1;
710710
buildActionMask = 2147483647;
711711
files = (
712712
);
@@ -716,34 +716,23 @@
716716
);
717717
runOnlyForDeploymentPostprocessing = 0;
718718
shellPath = /bin/sh;
719-
shellScript = "cp \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\" \"$TARGET_BUILD_DIR/commandLine\";\t\n#echo mv \"$TARGET_BUILD_DIR/commandLinePG\" \"$TARGET_BUILD_DIR/projectGenerator\"\ncp \"$TARGET_BUILD_DIR/commandLine\" \"$TARGET_BUILD_DIR/projectGenerator\"\nrm \"$TARGET_BUILD_DIR/commandLine\"\n";
719+
shellScript = "cp \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\" \"$TARGET_BUILD_DIR/projectGenerator\";\t\n";
720+
showEnvVarsInLog = 0;
720721
};
721-
E42962A92163ECCD00A6A9E2 /* ShellScript */ = {
722+
E42962A92163ECCD00A6A9E2 /* Run Script - Compile OF */ = {
722723
isa = PBXShellScriptBuildPhase;
723724
buildActionMask = 2147483647;
724725
files = (
725726
);
726727
inputPaths = (
727728
);
729+
name = "Run Script - Compile OF";
728730
outputPaths = (
729731
);
730732
runOnlyForDeploymentPostprocessing = 0;
731733
shellPath = /bin/sh;
732734
shellScript = "xcodebuild -project \"$OF_PATH/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj\" -target openFrameworks -configuration \"${CONFIGURATION}\" CLANG_CXX_LANGUAGE_STANDARD=$CLANG_CXX_LANGUAGE_STANDARD MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET\n";
733735
};
734-
E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = {
735-
isa = PBXShellScriptBuildPhase;
736-
buildActionMask = 2147483647;
737-
files = (
738-
);
739-
inputPaths = (
740-
);
741-
outputPaths = (
742-
);
743-
runOnlyForDeploymentPostprocessing = 0;
744-
shellPath = /bin/sh;
745-
shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n# Copy default icon file into App/Resources\necho 'icon file'\necho $ICON_FILE\necho 'target build dir'\necho $TARGET_BUILD_DIR\necho rsync -aved \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n\n#rsync -aved \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n";
746-
};
747736
/* End PBXShellScriptBuildPhase section */
748737

749738
/* Begin PBXSourcesBuildPhase section */

commandLine/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "ofMain.h"
1+
//#include "ofMain.h"
22
#include "optionparser.h"
33
#include "defines.h"
44
enum optionIndex { UNKNOWN, HELP, PLUS, RECURSIVE, LISTTEMPLATES, PLATFORMS, ADDONS, OFPATH, VERBOSE, TEMPLATE, DRYRUN, SRCEXTERNAL, VERSION};

scripts/osx/buildPG.sh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
5-
64
echoDots(){
75
sleep 0.1 # Waiting for a brief period first, allowing jobs returning immediatly to finish
86
while isRunning $1; do
@@ -128,12 +126,24 @@ cd ..
128126
of_root=${PWD}/openFrameworks
129127
pg_root=${PWD}/openFrameworks/apps/projectGenerator
130128

131-
git clone --depth=1 https://github.com/openframeworks/openFrameworks
129+
if [ -d "openframeworks/.git" ]; then
130+
echo 'OF already cloned, using it'
131+
# cd openframeworks
132+
# git pull
133+
# Control will enter here if $DIRECTORY exists.
134+
else
135+
git clone --depth=1 https://github.com/openframeworks/openFrameworks
136+
fi
132137
#cp not move so github actions can do cleanup without error
133138
cp -r projectGenerator openFrameworks/apps/
134139

135140
cd ${of_root}
136-
scripts/osx/download_libs.sh
141+
if [ -d "libs/glfw" ]; then
142+
echo 'libs installed, using them'
143+
else
144+
scripts/osx/download_libs.sh
145+
fi
146+
137147

138148
# Compile commandline tool
139149
cd ${pg_root}
@@ -145,9 +155,15 @@ if [ $ret -ne 0 ]; then
145155
exit 1
146156
fi
147157

158+
159+
148160
# install electron sign globally
149161
sudo npm install -g electron-osx-sign
150-
sudo chown -R 501:20 "/Users/runner/.npm"
162+
163+
if [ -d "/Users/runner/" ]; then
164+
sudo chown -R 501:20 "/Users/runner/.npm"
165+
fi
166+
151167
import_certificate
152168

153169
# Generate electron app
@@ -171,3 +187,8 @@ sign_and_upload android
171187
rm -rf scripts/id_rsa 2> /dev/null
172188
rm -rf scripts/*.p12 2> /dev/null
173189

190+
191+
# pwd
192+
# ls -alfR
193+
# cd ..
194+
# pwd

0 commit comments

Comments
 (0)