Skip to content

Commit

Permalink
Fix UPM package generation issues for UWP (#406)
Browse files Browse the repository at this point in the history
* Include .asmdef files for correct UPM package generation

* Fix missing Integrations .meta file position

* Splitting out UnityGLTFEditor scripts with its own asmdef file

* Build script updates to properly support UWP with UPM compliant package

* Include .asmdef files for correct UPM package generation

* Fix missing Integrations .meta file position

* Splitting out UnityGLTFEditor scripts with its own asmdef file

* Build script updates to properly support UWP with UPM compliant package

* Fixing Travis build environment issues

* Include .asmdef files for correct UPM package generation

* Fix missing Integrations .meta file position

* Splitting out UnityGLTFEditor scripts with its own asmdef file

* Build script updates to properly support UWP with UPM compliant package

* Fixing Travis build environment issues

* Pull down upstream changes

* Fixing merge conflict

* Add Roughness float values to MetalRoughMap.cs

* Add names to textures created by GLTFSceneImporter

* Fix texture memory leak

* Add task cancellation support

* Add image name to texture name

* Update UnityGLTF/Assets/UnityGLTF/Scripts/Cache/RefCountedCacheData.cs

Co-Authored-By: rferrese <[email protected]>

* Change cancellation in ConstructMesh

* Camera in test scenes now moves only when dragged (mousedown) and the movement math is cleaner and more accurate, and zoom is now exponential instead of linear. (#413)

Also clean up some warnings around unused variables.

* Fix loading time issue (#414)

* Simplify AsyncCoroutineHelper

* revert default budget

* Add missing meta file for integration test directory (#419)

* Add a component to display the list of models from gltf-Sample-Models and let you load them (#420)

* Add a component to display the list of sample models and let you load them at runtime.

* Some improvements to the model list loader and adding a main scene to host it

* Fix warning suppression

* Address pr feedback.  Remove commented line.  Give a nice error if the model list json fails to download.  Also improve orbit camera so that scrolling the other list doesn't cause it to zoom.

* OrbitCamera now supports right mouse buttons to change position (#422)

* right mouse camera controls

* More accurate right click mouse motion

* Set the correct filter mode when loading texture samplers (#421)

* Include .asmdef files for correct UPM package generation

* Fix missing Integrations .meta file position

* Splitting out UnityGLTFEditor scripts with its own asmdef file

* Build script updates to properly support UWP with UPM compliant package

* Include .asmdef files for correct UPM package generation

* Splitting out UnityGLTFEditor scripts with its own asmdef file

* Fixing Travis build environment issues

* Include .asmdef files for correct UPM package generation

* Splitting out UnityGLTFEditor scripts with its own asmdef file

* Pull down upstream changes

* Fixing merge conflict

* Enable Azure Pipelines UPM releases (#2)

* Update Export-upm-packages.sh to support Azure Pipelines
* Remove UPM Package generation from .travis.yml

UPM package generation now works with Azure Pipelines
  • Loading branch information
ei2kpi-ptc authored and AdamMitchell-ms committed May 15, 2019
1 parent 4cc9649 commit 29f5bef
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 15 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ install:
- sudo python2 ./scripts/install-unity.py --package Unity 2017.1.1f1
before_script:
- sudo chmod -R a+rwx /Applications/Unity
- sudo chmod +x ./scripts/export-upm-package.sh
script:
- msbuild ./GLTFSerialization/GLTFSerialization.sln /t:GLTFSerialization /p:TargetFramework=net35
- "./scripts/export-upm-package.sh"
- "./scripts/export-unity-package.sh"
deploy:
provider: releases
file:
- "./current-package/UnityGLTF.unitypackage"
- "./current-package/org.khronos.UnityGLTF.zip"
skip_cleanup: true
on:
repo: KhronosGroup/UnityGLTF
branch: releases
tags: true
api-key:
secure: "KBs5cOzqEoTDzsBv6AurzlFMtgfctKbJWsGorUW9BE/+B8pnriGQxc1Lt83kzkvHkcF+MgqD5M1KK6SebB/lgpE2Xo/Zu/al1Sr0M6MNijRgHCx0aqea+/mjXfHS7qhbOqgEqQHYoR4kOqIKFhJZOohtLBylnDgFojG42Z2UFnbSelZaAT8qISxndX5qjIqV9+CgkRlpwyY4tnQ2fzVwuyFMvEqSBUzAegzPa+nQu1HgJzx64OP0ONmoTPJnUr0C741GtsD1fA6SMjSpwhjiYezQXapN2a/YoZufEkrd5wYq8Q1UVNMDmkmtg1zA0LkmK1u6dEhE7VCjxL7CW13FWGWEMKR9h2afTl+QkRIZxNRxjVHcWG122oTSCOXaAwBtNHMnWEgBy+DYFWAYD/bMmZ+g70EZ2/bFEfPprhyOvK59No5V65FOyoIMSBZvgU1z2Kl3PPTUl/0vEljX3RiON6BvIbOxU7OdR+OI35naSfos76YWK58+b99fRC0rJq6egwhNTACPItrtdmZq13k/5PWfGSJ0IAegdoXCB1eFP6SqcoXDsxLJph8/nHrEHqyjtl9PYBturvzVfQThTzL4FQuB7Fypwql/PXB7mdG7HkOvcM5jJWiupIsQxw5VkArZhnBk188ds+UC42tUhF701ZrPJz6GF0Kqem7/Fr/6l7A="

16 changes: 16 additions & 0 deletions UnityGLTF/Assets/UnityGLTF/Scripts/Editor/UnityGLTFEditor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "UnityGLTFEditor",
"references": [
"UnityGLTFScripts"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}

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

2 changes: 1 addition & 1 deletion UnityGLTF/Assets/UnityGLTF/Scripts/Tests/Integration.meta

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

17 changes: 17 additions & 0 deletions UnityGLTF/Assets/UnityGLTF/Scripts/Tests/UnityGLTFTests.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "UnityGLTFTests",
"references": [
"UnityGLTFScripts",
"UnityGLTFEditor"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}

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

3 changes: 3 additions & 0 deletions UnityGLTF/Assets/UnityGLTF/Scripts/UnityGLTFScripts.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "UnityGLTFScripts"
}

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

44 changes: 33 additions & 11 deletions scripts/export-upm-package.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
#! /bin/sh
#! /bin/bash

project_path=$(pwd)/UnityGLTF
log_file=$(pwd)/build/unity-mac.log

cached_folder=$(pwd)
upm_name=org.khronos.UnityGLTF
echo "##vso[task.setvariable variable=UPM_NAME]$upm_name"
upm_src_folder_path=$(pwd)/UnityGLTF/Assets/UnityGLTF
upm_manifest_path=$(pwd)/scripts/package.json
upm_staging_path=$(pwd)/current-package/$upm_name
upm_staging_UWP_plugins_path=$upm_staging_path/UnityGLTF/Plugins/uap10.0.10586
upm_zip_export_path=$(pwd)/current-package/$upm_name.zip
upm_targz_export_path=$(pwd)/current-package/$upm_name.tar.gz

if [[ $BUILD_SOURCEBRANCH == *"refs/tags"* ]]; then
echo "Detected refs/tags in $BUILD_SOURCEBRANCH so this must be a tagged release build."
# Splits the string with "refs/tags", takes the second value and then
# swaps out any slashes for underscores
GIT_TAG=$(echo $BUILD_SOURCEBRANCH | awk -F'refs/tags/' '{print $2}' | tr '/' '_')
echo "Setting GIT_TAG variable to: $GIT_TAG"
echo "##vso[task.setvariable variable=GIT_TAG]$GIT_TAG"
else
echo "Did not detect refs/tags in $BUILD_SOURCEBRANCH so skipping GIT_TAG variable set"
fi

# msbuild spits out every single dependency dll for UWP
# These are the only files that are needed by the UPM package for Unity 2018.3+
# Including all the files in the UWP plugin directory causes name collision errors when
# building for UWP in Unity
upm_UWP_Plugins=(
"GLTFSerialization.dll"
"GLTFSerialization.dll.meta"
"GLTFSerialization.pdb"
"Newtonsoft.Json.dll"
"Newtonsoft.Json.dll.meta"
)

error_code=0
echo $upm_name
echo $upm_src_folder_path
Expand All @@ -28,14 +53,11 @@ cp -r $upm_src_folder_path $upm_staging_path
echo "Changing to $upm_staging_path folder"
cd $upm_staging_path

echo "Creating .zip of UPM package"
sudo zip -r $upm_zip_export_path ./

echo "Creating .tar.gz of UPM package"
tar -zcvf $upm_targz_export_path ./

echo "Changing back to original folder $cached_folder"
cd $cached_folder
echo "Cleaning out UWP plugin DLLs that are not needed for Unity2018.3+"
find $upm_staging_UWP_plugins_path -maxdepth 1 -type f | grep -vE "$(IFS=\| && echo "${upm_UWP_Plugins[*]}")" | xargs rm

echo "Finishing with code $error_code"
exit $error_code
echo "Files left in $upm_staging_UWP_plugins_path"
for entry in "$upm_staging_UWP_plugins_path"/*
do
echo "$entry"
done

0 comments on commit 29f5bef

Please sign in to comment.