- Home /
Automate importing of .unitypackages?
We have several third-party packages that we'd like to integrate into our Unity project. We've checked the .unitypackage files into our source control system (subversion). We have an automated build process that builds the unity project. It uses the following command line:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath <path/to/project> -executeMethod <method_that_executes_build>
Before we execute this step, we'd like to import these third-party packages into our project. I've tried the -importProject command-line option. The problem is that some of our .cs scripts reference classes declared in .cs scripts found in the third-party packages. Thus, unity throws an error when compiling our script because the .cs files from the .unitypackages haven't been imported and don't yet exist on the system. Importing manually in the Unity GUI environment isn't a problem - the compiler errors are listed but go away when you import the packages (Assets/Import Package/Custom Package). However, when run from the command-line, Unity exits unsuccessfully when it encounters the first compile error.
Is there a way to force the project to import packages before trying to compile our .cs scripts?
This seems to still not work. A real showstopper for automated builds.
Answer by HSz · Jul 11, 2014 at 10:20 AM
Just for future reference, we are using uTomate (https://www.assetstore.unity3d.com/en/#!/content/7703) to do something similar. They have a package-import action.
for u$$anonymous$$ate. It's invaluable for tasks like this.
Answer by Cardinalby · May 19, 2015 at 07:18 PM
Move your editor script which imports packages into dll, place dll in Editor folder and it will work fine even if there are compile errors in your project