Skip to content

Commit

Permalink
Merge pull request #68 from artoolkitx/phil-ios-build
Browse files Browse the repository at this point in the history
Phil ios build
  • Loading branch information
philip-lamb authored May 16, 2023
2 parents 6aa0a13 + 99cbc7c commit b891f8a
Show file tree
Hide file tree
Showing 14 changed files with 198 additions and 39 deletions.
7 changes: 7 additions & 0 deletions Release Notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# artoolkitX for Unity Release Notes
------------------------------------

## Version 1.1.9
### 2023-05-15

Changes:
* Updated the Unity project to Unity 2021.3.25f1.
* Updated the native plugin to artoolkitX v1.1.8.

## Version 1.1.8
### 2023-05-14

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9ac62947536a3704295fb870f025f1e1, type: 3}
m_Name:
m_EditorClassIdentifier:
eventReceiver: {fileID: 0}
Stereo: 0
StereoEye: 1
Optical: 0
Expand Down Expand Up @@ -638,6 +637,8 @@ MonoBehaviour:
currentNFTMultiMode: 0
currentTwoDMaxMarkersToTrack: 1
currentLogLevel: 1
currentSquareMatrixModeAutocreateNewTrackables: 0
currentSquareMatrixModeAutocreateNewTrackablesDefaultWidth: 0.08
scrollPosition: {x: 0, y: 0}
--- !u!4 &1192976671
Transform:
Expand Down Expand Up @@ -1098,9 +1099,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e02d1ce5da0c446acaea956b6ae07690, type: 3}
m_Name:
m_EditorClassIdentifier:
_trackableTag: kanji
secondsToRemainVisible: 0
OnTrackedObjectFound:
m_PersistentCalls:
m_Calls: []
OnTrackedObjectTracked:
m_PersistentCalls:
m_Calls: []
OnTrackedObjectLost:
m_PersistentCalls:
m_Calls: []
eventReceiver: {fileID: 0}
_trackableTag: kanji
--- !u!1 &1562006351
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1240,9 +1250,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e02d1ce5da0c446acaea956b6ae07690, type: 3}
m_Name:
m_EditorClassIdentifier:
_trackableTag: hiro
secondsToRemainVisible: 0
OnTrackedObjectFound:
m_PersistentCalls:
m_Calls: []
OnTrackedObjectTracked:
m_PersistentCalls:
m_Calls: []
OnTrackedObjectLost:
m_PersistentCalls:
m_Calls: []
eventReceiver: {fileID: 0}
_trackableTag: hiro
--- !u!1 &2045854512
GameObject:
m_ObjectHideFlags: 0
Expand Down
8 changes: 0 additions & 8 deletions Source/Package/Assets/artoolkitX-Unity/Plugins/x86.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public class ARToolKitMenuEditor : MonoBehaviour {
private const string SOURCE_URL = "https://github.com/artoolkitx/artoolkitx";
private const string PLUGIN_SOURCE_URL = "https://github.com/artoolkitx/arunityx";
//private const string TOOLS_URL = "http://artoolkit.org/download-artoolkit-sdk#unity";
private const string VERSION = MENU_PATH_BASE + "/artoolkitX for Unity Version 1.1.8";
private const string VERSION = MENU_PATH_BASE + "/artoolkitX for Unity Version 1.1.9";
private const string WINDOWS_UNITY_MESSAGE = "Thank you for choosing artoolkitX for Unity! " +
"<b>artoolkitX requires the Microsoft C++ Redistributables to be installed on your system.</b>\n" +
"Please select \"{0}\" from the menu above, and install the required packages.";
private const string GET_TOOLS_MESSAGE = "artoolkitX for Unity Version 1.1.8! <b>To make your own markers, you'll need to download our tools.</b>\n" +
private const string GET_TOOLS_MESSAGE = "artoolkitX for Unity Version 1.1.9! <b>To make your own markers, you'll need to download our tools.</b>\n" +
"Please select {0} from menu above to download them.";

static ARToolKitMenuEditor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
* are not obligated to do so. If you do not wish to do so, delete this exception
* statement from your version.
*
* Copyright 2023 Philip Lamb
* Copyright 2015 Daqri, LLC.
*
* Author(s): Wally Young
* Author(s): Wally Young, Philip Lamb
*
*/

Expand Down Expand Up @@ -64,10 +65,14 @@ public class ARToolKitPostProcessor : IPostprocessBuildWithReport
};

// Setting name, value to add.
private static Tuple<string, string>[] IosBuildValues = {
private static Tuple<string, string>[] IosBuildValuesToAdd = {
new Tuple<string, string>("OTHER_LDFLAGS", "-lsqlite3"),
};

private static Tuple<string, string>[] IosBuildValuesToSetInProject = {
new Tuple<string, string>("ENABLE_BITCODE", "NO"),
};

private static StreamWriter streamWriter = null;
#endif

Expand Down Expand Up @@ -99,7 +104,6 @@ public void OnPostprocessBuild(BuildReport report) {
foreach (string redistFile in REDIST_FILES) {
File.Move(Path.Combine(fromPath, redistFile), Path.Combine(pathDirectory, redistFile));
}
}
#elif UNITY_IPHONE
const string LOGFILE_NAME = "postprocess.log";

Expand All @@ -125,21 +129,26 @@ public void OnPostprocessBuild(BuildReport report) {
PBXProject project = new PBXProject();
project.ReadFromFile(pbxprojPath);

string g = project.GetUnityFrameworkTargetGuid();
string unityFrameworkGUID = project.GetUnityFrameworkTargetGuid();

streamWriter.WriteLine("OnIosPostProcess - Modifying file at " + pbxprojPath);

foreach (var f in IosFrameworks)
{
project.AddFrameworkToProject(g, f.Item1, f.Item2);
project.AddFrameworkToProject(unityFrameworkGUID, f.Item1, f.Item2);
}

foreach (var bv in IosBuildValues)
foreach (var bv in IosBuildValuesToAdd)
{
project.AddBuildProperty(g, bv.Item1, bv.Item2);
project.AddBuildProperty(unityFrameworkGUID, bv.Item1, bv.Item2);
//project.UpdateBuildProperty(g, bv.Item1, new string[] { bv.Item2 }, new string[] { });
}

foreach (var bv in IosBuildValuesToSetInProject)
{
project.SetBuildProperty(project.ProjectGuid(), bv.Item1, bv.Item2);
}

project.WriteToFile(pbxprojPath);

streamWriter.WriteLine("OnIosPostProcess - Ending iOS post-processing successfully.");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* ARToolKitPreprocessor.cs
* artoolkitX for Unity
*
* This file is part of artoolkitX for Unity.
*
* artoolkitX for Unity is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* artoolkitX for Unity is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with artoolkitX for Unity. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, the copyright holders of this library give you
* permission to link this library with independent modules to produce an
* executable, regardless of the license terms of these independent modules, and to
* copy and distribute the resulting executable under terms of your choice,
* provided that you also meet, for each linked independent module, the terms and
* conditions of the license of that module. An independent module is a module
* which is neither derived from nor based on this library. If you modify this
* library, you may extend this exception to your version of the library, but you
* are not obligated to do so. If you do not wish to do so, delete this exception
* statement from your version.
*
* Copyright 2023 Philip Lamb
*
* Author(s): Philip Lamb
*
*/

using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

public class ARToolKitPreprocessor : IPreprocessBuildWithReport
{
public int callbackOrder { get { return 0; } }

public void OnPreprocessBuild(BuildReport report)
{
const string cameraUsageDescRequired = "Camera usage description required, but not set in player settings.";
const string cameraUsageDescDefault = "Required for AR tracking. Video is used in realtime, and is not stored or transmitted outside the app.";
const bool cameraUsageDescFailIfMissing = false;

BuildTarget platform = report.summary.platform;

if (platform == BuildTarget.iOS)
{
string cameraUsageDescription = PlayerSettings.iOS.cameraUsageDescription;
if (string.IsNullOrWhiteSpace(cameraUsageDescription)) {
if (cameraUsageDescFailIfMissing)
{
throw new BuildFailedException(cameraUsageDescRequired);
}
else
{
Debug.LogWarning(cameraUsageDescRequired + "Set to default.");
PlayerSettings.iOS.cameraUsageDescription = cameraUsageDescDefault;
}

}
}
else if (platform == BuildTarget.StandaloneOSX)
{
string cameraUsageDescription = PlayerSettings.macOS.cameraUsageDescription;
if (string.IsNullOrWhiteSpace(cameraUsageDescription))
{
if (cameraUsageDescFailIfMissing)
{
throw new BuildFailedException(cameraUsageDescRequired);
}
else
{
Debug.LogWarning(cameraUsageDescRequired + "Set to default.");
PlayerSettings.macOS.cameraUsageDescription = cameraUsageDescDefault;
}
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Source/Package/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.analytics": "3.6.12",
"com.unity.ide.visualstudio": "2.0.17",
"com.unity.ide.visualstudio": "2.0.18",
"com.unity.ide.vscode": "1.2.5",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.4",
"com.unity.timeline": "1.6.5",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.10",
"com.unity.modules.ai": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions Source/Package/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.17",
"version": "2.0.18",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -59,7 +59,7 @@
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.6.4",
"version": "1.6.5",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
35 changes: 29 additions & 6 deletions Source/Package/ProjectSettings/EditorSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,42 @@
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_ExternalVersionControlSupport: Hidden Meta Files
serializedVersion: 11
m_SerializationMode: 2
m_LineEndingsForNewScripts: 1
m_DefaultBehaviorMode: 0
m_PrefabRegularEnvironment: {fileID: 0}
m_PrefabUIEnvironment: {fileID: 0}
m_SpritePackerMode: 0
m_SpritePackerPaddingPower: 1
m_Bc7TextureCompressor: 0
m_EtcTextureCompressorBehavior: 1
m_EtcTextureFastCompressor: 1
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
m_ProjectGenerationRootNamespace:
m_UserGeneratedProjectSuffix:
m_CollabEditorSettings:
inProgressEnabled: 1
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 1
m_AsyncShaderCompilation: 1
m_CachingShaderPreprocessor: 1
m_PrefabModeAllowAutoSave: 1
m_EnterPlayModeOptionsEnabled: 0
m_EnterPlayModeOptions: 3
m_GameObjectNamingDigits: 1
m_GameObjectNamingScheme: 0
m_AssetNamingUsesSpace: 1
m_UseLegacyProbeSampleCount: 1
m_SerializeInlineMappingsOnOneLine: 0
m_DisableCookiesInLightmapper: 1
m_AssetPipelineMode: 1
m_RefreshImportMode: 0
m_CacheServerMode: 0
m_CacheServerEndpoint:
m_CacheServerNamespacePrefix: default
m_CacheServerEnableDownload: 1
m_CacheServerEnableUpload: 1
m_CacheServerEnableAuth: 0
m_CacheServerEnableTls: 0
m_CacheServerValidationMode: 2
m_CacheServerDownloadBatchSize: 128
Loading

0 comments on commit b891f8a

Please sign in to comment.