@@ -160,6 +160,11 @@ if [ $BUILD_MACOS ] ; then
160
160
# Make the version number available to Xcode.
161
161
cp macOS/user-config-in.xcconfig macOS/user-config.xcconfig
162
162
sed -E -i " " -e " s/@VERSION@/${VERSION} /" macOS/user-config.xcconfig
163
+
164
+ # Insert the calibration server upload URL and authentication tokens into the build config.
165
+ if [[ ! -z " ${ARTOOLKITX_CSUU} " && ! -z " ${ARTOOLKITX_CSAT} " ]]; then
166
+ echo " GCC_PREPROCESSOR_DEFINITIONS=ARTOOLKITX_CSUU=\\\" ${ARTOOLKITX_CSUU//// \/ } \\\" ARTOOLKITX_CSAT=\\\" ${ARTOOLKITX_CSAT} \\\" " >> macOS/user-config.xcconfig
167
+ fi
163
168
164
169
(cd macOS
165
170
xcodebuild -target " artoolkitX Camera Calibration Utility" -configuration Release
@@ -188,6 +193,10 @@ if [ $BUILD_IOS ] ; then
188
193
cp iOS/user-config-in.xcconfig iOS/user-config.xcconfig
189
194
sed -E -i " " -e " s/@VERSION@/${VERSION} /" iOS/user-config.xcconfig
190
195
196
+ # Insert the calibration server upload URL and authentication tokens into the build config.
197
+ if [[ ! -z " ${ARTOOLKITX_CSUU} " && ! -z " ${ARTOOLKITX_CSAT} " ]]; then
198
+ echo " GCC_PREPROCESSOR_DEFINITIONS=ARTOOLKITX_CSUU=\\\" ${ARTOOLKITX_CSUU//// \/ } \\\" ARTOOLKITX_CSAT=\\\" ${ARTOOLKITX_CSAT} \\\" " >> iOS/user-config.xcconfig
199
+ fi
191
200
(cd iOS
192
201
xcodebuild -target " artoolkitX Camera Calibration Utility" -configuration Release -destination generic/platform=iOS
193
202
)
@@ -223,6 +232,13 @@ if [ $BUILD_ANDROID ] ; then
223
232
sed -E -i.bak -e " s/versionCode [0-9]+/versionCode ${VERSION_INT} /" -e " s/versionName \" [0-9\.]+\" /versionName \" ${VERSION} \" /" Android/app/build.gradle
224
233
rm -f Android/app/build.gradle.bak
225
234
235
+ # Insert the calibration server upload URL and authentication tokens on the Java side. On the C/C++ side, this is done by in CMakeLists.txt.
236
+ if [[ ! -z " ${ARTOOLKITX_CSUU} " && ! -z " ${ARTOOLKITX_CSAT} " ]]; then
237
+ sed -E -i.bak -e " s/ARTOOLKITX_CSUU *= *\" .*\" /ARTOOLKITX_CSUU = \" ${ARTOOLKITX_CSUU//// \/ } \" /" Android/app/src/main/java/org/artoolkitx/utilities/cameracalibration/Config.java
238
+ sed -E -i.bak -e " s/ARTOOLKITX_CSAT *= *\" .*\" /ARTOOLKITX_CSAT = \" ${ARTOOLKITX_CSAT// &/ \& } \" /" Android/app/src/main/java/org/artoolkitx/utilities/cameracalibration/Config.java
239
+ rm -f Android/app/src/main/java/org/artoolkitx/utilities/cameracalibration/Config.java.bak
240
+ fi
241
+
226
242
(cd " ${OURDIR} /Android"
227
243
echo " Building Android project"
228
244
./gradlew assembleRelease
0 commit comments