Skip to content

Commit a18abe2

Browse files
authored
Merge pull request #174 from Unity-Technologies/Uni-27149-update-readme
Uni-27149-update-readme
2 parents 4e7acf1 + b3132aa commit a18abe2

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ add_custom_target(
9494

9595
###########################################################################
9696
# Add target to replace the unity package version number in files
97+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
98+
set(VERSION_AS_STRING "\\'${PACKAGE_VERSION}\\'")
99+
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
100+
set(VERSION_AS_STRING "'${PACKAGE_VERSION}'")
101+
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
102+
set(VERSION_AS_STRING "\\'${PACKAGE_VERSION}\\'")
103+
endif()
104+
97105
set(README_TARGET readme_replace)
98106
add_custom_target(
99107
${README_TARGET}
@@ -106,9 +114,9 @@ add_custom_target(
106114
"${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
107115
"${CMAKE_SOURCE_DIR}/Assets/FbxExporters/Integrations/Autodesk/maya/scripts/UnityFbxForMaya/version.py"
108116
".*VERSION.*=.*"
109-
"VERSION = '${PACKAGE_VERSION}'"
117+
"VERSION = ${VERSION_AS_STRING}"
110118
DEPENDS "${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
111-
COMMENT "Replacing version number in files"
119+
COMMENT "Replacing version number in files with ${PACKAGE_VERSION}"
112120
)
113121

114122
###########################################################################

scripts/install_package.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#! /bin/sh
2+
########################################################################
3+
# Copyright (c) 2017 Unity Technologies. All rights reserved.
4+
# NOTICE: All information contained herein is, and remains
5+
# the property of Unity Technologies Aps. and its suppliers,
6+
# if any. The intellectual and technical concepts contained
7+
# herein are proprietary to Unity Technologies Aps. and its
8+
# suppliers and may be covered by Canadian, U.S. and/or
9+
# Foreign Patents, patents in process, and are protected
10+
# by trade secret or copyright law. Dissemination of this
11+
# information or reproduction of this material is strictly
12+
# forbidden unless prior written permission is obtained from
13+
# Unity Technologies Aps.
14+
#
15+
########################################################################
16+
17+
# Configure where Unity is installed
18+
if [ ! -f "${UNITY_EDITOR_PATH}" ]; then
19+
UNITY_EDITOR_PATH="/Applications/Unity/Unity.app/Contents/MacOS/Unity"
20+
fi
21+
echo "Using UNITY_EDITOR_PATH=${UNITY_EDITOR_PATH}"
22+
23+
# Configure which Unity project to install package
24+
if [ ! -d "${PROJECT_PATH}" ]; then
25+
PROJECT_PATH=~/Development/FbxExporters
26+
fi
27+
echo "Using PROJECT_PATH=${PROJECT_PATH}"
28+
29+
# Configure where unitypackage is located
30+
if [ ! -f "${PACKAGE_PATH}" ]; then
31+
PACKAGE_PATH=`ls -t ${PROJECT_PATH}/FbxExporters_*.unitypackage | head -1`
32+
fi
33+
echo "Using PACKAGE_PATH=${PACKAGE_PATH}"
34+
35+
if [ ! -f "${UNITY_EDITOR_PATH}" ]; then
36+
echo "Unity is not installed in default location"
37+
exit -1
38+
fi
39+
40+
if [ -d "${PROJECT_PATH}/Assets/FbxExporters" ]; then
41+
echo "Uninstalling previous package"
42+
rm -rf "${PROJECT_PATH}/Assets/FbxExporters"
43+
fi
44+
45+
# Install FbxExporters package
46+
"${UNITY_EDITOR_PATH}" -projectPath "${PROJECT_PATH}" -importPackage ${PACKAGE_PATH} -quit
47+
48+
exit 0

0 commit comments

Comments
 (0)