Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UPM package generation issues for UWP #406

Merged
merged 48 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1ae1353
Include .asmdef files for correct UPM package generation
ei2kpi-ptc Apr 6, 2019
3189a4c
Fix missing Integrations .meta file position
ei2kpi-ptc Apr 16, 2019
2531da1
Splitting out UnityGLTFEditor scripts with its own asmdef file
ei2kpi-ptc Apr 16, 2019
03fdae4
Build script updates to properly support UWP with UPM compliant package
ei2kpi-ptc Apr 16, 2019
9081e88
Include .asmdef files for correct UPM package generation
ei2kpi-ptc Apr 6, 2019
658bb48
Fix missing Integrations .meta file position
ei2kpi-ptc Apr 16, 2019
b425c07
Splitting out UnityGLTFEditor scripts with its own asmdef file
ei2kpi-ptc Apr 16, 2019
4d77390
Build script updates to properly support UWP with UPM compliant package
ei2kpi-ptc Apr 16, 2019
454392f
Merge branch 'master' of https://github.com/ei2kpi-ptc/UnityGLTF
ei2kpi-ptc Apr 16, 2019
c5de2bb
Fixing Travis build environment issues
ei2kpi-ptc Apr 16, 2019
1e77076
Include .asmdef files for correct UPM package generation
ei2kpi-ptc Apr 6, 2019
618e7fc
Fix missing Integrations .meta file position
ei2kpi-ptc Apr 16, 2019
bde9f8e
Splitting out UnityGLTFEditor scripts with its own asmdef file
ei2kpi-ptc Apr 16, 2019
6510efe
Build script updates to properly support UWP with UPM compliant package
ei2kpi-ptc Apr 16, 2019
d537816
Fixing Travis build environment issues
ei2kpi-ptc Apr 16, 2019
3b11d75
Pull down upstream changes
ei2kpi-ptc Apr 16, 2019
fec3917
Merge branch 'master' of https://github.com/ei2kpi-ptc/UnityGLTF
ei2kpi-ptc Apr 16, 2019
0256aef
Fixing merge conflict
ei2kpi-ptc Apr 16, 2019
1268354
Add Roughness float values to MetalRoughMap.cs
Apr 16, 2019
ec7ee91
Add names to textures created by GLTFSceneImporter
Apr 16, 2019
0d0d69a
Fix texture memory leak
Apr 16, 2019
72ab445
Add task cancellation support
Apr 17, 2019
7276371
Add image name to texture name
Apr 22, 2019
bf563f2
Update UnityGLTF/Assets/UnityGLTF/Scripts/Cache/RefCountedCacheData.cs
AdamMitchell-ms Apr 22, 2019
a1cdacb
Change cancellation in ConstructMesh
Apr 22, 2019
b62aeed
Merge pull request #409 from rferrese/MemLeak
sbtron Apr 22, 2019
c5b4a79
Merge pull request #408 from rferrese/TextureNames
sbtron Apr 22, 2019
15eaedd
Merge pull request #407 from rferrese/RoughnessFactor
sbtron Apr 22, 2019
046c7e2
Merge pull request #412 from rferrese/TaskCancellation
sbtron Apr 22, 2019
4d9782b
Camera in test scenes now moves only when dragged (mousedown) and the…
AdamMitchell-ms Apr 24, 2019
f97889a
Fix loading time issue (#414)
AdamMitchell-ms Apr 26, 2019
ca479b5
Add missing meta file for integration test directory (#419)
admachina Apr 29, 2019
e04883a
Add a component to display the list of models from gltf-Sample-Models…
AdamMitchell-ms Apr 30, 2019
740bbb8
OrbitCamera now supports right mouse buttons to change position (#422)
AdamMitchell-ms May 3, 2019
eaebdb0
Set the correct filter mode when loading texture samplers (#421)
AdamMitchell-ms May 3, 2019
03d7894
Include .asmdef files for correct UPM package generation
ei2kpi-ptc Apr 6, 2019
6752e09
Fix missing Integrations .meta file position
ei2kpi-ptc Apr 16, 2019
d11a940
Splitting out UnityGLTFEditor scripts with its own asmdef file
ei2kpi-ptc Apr 16, 2019
ff148a9
Build script updates to properly support UWP with UPM compliant package
ei2kpi-ptc Apr 16, 2019
8e34f65
Include .asmdef files for correct UPM package generation
ei2kpi-ptc Apr 6, 2019
ae9e685
Splitting out UnityGLTFEditor scripts with its own asmdef file
ei2kpi-ptc Apr 16, 2019
e4c461b
Fixing Travis build environment issues
ei2kpi-ptc Apr 16, 2019
3bee462
Include .asmdef files for correct UPM package generation
ei2kpi-ptc Apr 6, 2019
0417355
Splitting out UnityGLTFEditor scripts with its own asmdef file
ei2kpi-ptc Apr 16, 2019
24f6c49
Pull down upstream changes
ei2kpi-ptc Apr 16, 2019
0afe060
Fixing merge conflict
ei2kpi-ptc Apr 16, 2019
ee841ab
Merge branch 'master' of https://github.com/ei2kpi-ptc/UnityGLTF
ei2kpi-ptc May 7, 2019
661944e
Enable Azure Pipelines UPM releases (#2)
ei2kpi-ptc May 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ before_script:
- 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"
- msbuild ./GLTFSerialization/GLTFSerialization.sln /t:GLTFSerialization
- "./scripts/export-upm-package.sh"
deploy:
provider: releases
file:
Expand Down
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.

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.

27 changes: 23 additions & 4 deletions scripts/export-upm-package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/bash

project_path=$(pwd)/UnityGLTF
log_file=$(pwd)/build/unity-mac.log
Expand All @@ -8,9 +8,22 @@ upm_name=org.khronos.UnityGLTF
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

# 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=(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, the packaging script would not need to maintain a white-list of individual files to package. Did you investigate to see if there are any flags to pass to msbuild to affect what gets output?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ei2kpi-ptc,
We're interested in taking this change. If you don't have time to look into possible msbuild flags, then let's get this change in for now. It currently has a merge conflict with a meta file. If you resolve that conflict, I can go ahead and complete this pull request for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdamMitchell-ms, sorry for the delay. Was pulled into some other work the last two weeks. I can fix the merge conflict but there is still an issue with travis building the right DLLs for UWP because it is on an OSX environment.

I spent some time looking at Azure Pipeline builds and have a process that works well off of my own fork of this project. However, it requires that I grant access to this GitHub repo to the correct Azure pipeline account etc. Who can I work with to get that implemented for this project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll probably take roughly an hour on the phone with someone that has the right access to this repo and to the azure pipeline account we want to use

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Khronoswebmaster , I think you have permissions to do what @ei2kpi-ptc is suggesting. What is the normal process for making changes to branch policies? I've approved the changes in this PR but haven't looked into the azure pipelines build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ei2kpi-ptc, Is there any reason not to complete this PR in the meantime? Is the travis build issue you mentioned a regression caused by this change? Or already broken and still broken with your change?

If it's the latter (existing issue that's not fixed), then I'll go ahead and complete the PR. If it's a regression, then I'll hold off for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdamMitchell-ms Yep, should be safe to accept the PR.
The travis DLL issue is an existing issue which will be fixed once we get Azure Pipelines enabled in this repo (it is already enabled and working in my fork). This PR has travis.yml only building / releasing the .unitypackage version which always had the UWP DLLs missing.

@Khronoswebmaster I set up Azure Pipelines for the UPM package on my fork by using the existing wizard flow which is why I need to work with whoever has the right access to the Azure DevOps account for KhronosGroup.
The yaml version of Azure Pipelines (which would be much more straightforward and similar to travis IMO) seems to have an existing issue with using secret GitHub credentials for the actual Release publishing step.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok @ei2kpi-ptc , I've completed this PR now.

"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 +41,20 @@ cp -r $upm_src_folder_path $upm_staging_path
echo "Changing to $upm_staging_path folder"
cd $upm_staging_path

echo "Cleaning out UWP plugin DLLs that are not needed for Unity2018.3+"
echo "Only keeping the following files:"
printf '%s\n' "${upm_UWP_Plugins[@]}"
find $upm_staging_UWP_plugins_path -maxdepth 1 -type f | grep -vE "$(IFS=\| && echo "${upm_UWP_Plugins[*]}")" | xargs rm

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

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

echo "Changing back to original folder $cached_folder"
cd $cached_folder

echo "Finishing with code $error_code"
exit $error_code
exit $error_code