File tree Expand file tree Collapse file tree 5 files changed +69
-14
lines changed
Expand file tree Collapse file tree 5 files changed +69
-14
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,5 @@ variables:
33
44jobs :
55- template : ../templates/jobs/cd.yml
6+ parameters :
7+ unityProject : false
Original file line number Diff line number Diff line change 1+ parameters :
2+ unityProject : true
3+
14jobs :
25- job : Job
36 displayName : CD
47 pool :
58 vmImage : vs2017-win2016
69 steps :
710 - template : ../steps/cd.yml
11+ parameters :
12+ unityProject : ${{ parameters.unityProject }}
Original file line number Diff line number Diff line change 1919 unityProject : ${{ parameters.unityProject }}
2020 unityVersion : ${{ parameters.unityVersion }}
2121 - template : ../steps/cd.yml
22+ parameters :
23+ unityProject : ${{ parameters.unityProject }}
Original file line number Diff line number Diff line change 1+ parameters :
2+ unityProject : true
3+
14steps :
25- ${{ if ne(variables['Build.Reason'], 'PullRequest') }} :
6+ - ${{ if parameters.unityProject }} :
7+ - bash : |
8+ npm pack
9+ tarball=$(npm list — depth 0 | sed "s/@/-/g; s/ .*/.tgz/g; 1q;")
10+ tarballFilePaths=$(tar -tf $tarball)
11+
12+ for filePath in $tarballFilePaths
13+ do
14+ case $filePath in
15+ *.meta)
16+ metaFilePath=$filePath
17+ found=false
18+ regularFilePath=${metaFilePath%.meta}
19+ for otherFilePath in $tarballFilePaths
20+ do
21+ case $otherFilePath in
22+ $regularFilePath/* | $regularFilePath*) # folder or file
23+ if [ $metaFilePath != $otherFilePath ]
24+ then
25+ found=true
26+ break
27+ fi;;
28+ esac
29+ done
30+ if [ "$found" = false ]
31+ then
32+ echo "Missing file for Unity meta file '$metaFilePath'." >&2
33+ fi;;
34+ esac
35+ done
36+
37+ for filePath in $tarballFilePaths
38+ do
39+ case $filePath in
40+ *.meta)
41+ ;;
42+ *)
43+ regularFilePath=$filePath
44+ found=false
45+ for otherFilePath in $tarballFilePaths
46+ do
47+ case $otherFilePath in
48+ $regularFilePath.meta)
49+ found=true
50+ break;;
51+ esac
52+ done
53+ if [ "$found" = false ]
54+ then
55+ echo "Missing Unity meta file for file '$regularFilePath'." >&2
56+ fi;;
57+ esac
58+ done
59+
60+ rm -f $tarball
61+ displayName: Check Unity .meta files
62+ failOnStderr: true
363 - bash : |
464 mv -f package.json package.json.original
565 cat > package.json <<- "EOF"
Original file line number Diff line number Diff line change @@ -57,17 +57,3 @@ steps:
5757 msbuildArchitecture : x64
5858 ${{ if parameters.unityProject }} :
5959 msbuildArgs : /p:UnityEditorAssembliesPath="$(Unity.Path)Editor/Data/Managed/"
60- - ${{ if parameters.unityProject }} :
61- - bash : |
62- for entry in $(find . -not -path "*/\.*" -not -path . -not -name "*.meta")
63- do if [ ! -f "$entry.meta" ]
64- then echo "Missing Unity meta file for '$entry'." >&2
65- fi
66- done
67- for entry in $(find . -not -path "*/\.*" -not -path . -name "*.meta")
68- do if [ ! -f ${entry::-5} ] && [ ! -d ${entry::-5} ]; then
69- echo "Missing file for Unity meta file '$entry'." >&2
70- fi
71- done
72- displayName: Check Unity .meta files
73- failOnStderr: true
You can’t perform that action at this time.
0 commit comments