Skip to content

Commit

Permalink
plus package
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed May 19, 2019
1 parent 20fea38 commit aa33823
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 17 deletions.
44 changes: 27 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,37 @@ jobs:
- unity_activate:
unity_version: << parameters.unity_version >>
unity_license: << parameters.unity_license >>
# - run:
# name: Build Linux(Mono)
# command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
# working_directory: src/RandomFixtureKit.Unity
# - run: src/RandomFixtureKit.Unity/bin/UnitTest/StandaloneLinux64_Mono2x/test
# build-and-create-package:
# executor: unity
# steps:
# - checkout
# - unity_activate
# - run:
# name: Export unitypackage
# command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
# working_directory: src/MagicOnion.Client.Unity
# - store_artifacts:
# path: src/MagicOnion.Client.Unity/MagicOnion.Client.Unity.unitypackage
# destination: /MagicOnion.Client.Unity.unitypackage
- run:
name: Build Linux(Mono)
command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
working_directory: .
- run: ./bin/UnitTest/StandaloneLinux64_Mono2x/test
build-and-create-package:
parameters:
unity_version: {type: string}
unity_license: {type: string}
executor:
name: unity
version: << parameters.unity_version >>
steps:
- checkout
- unity_activate:
unity_version: << parameters.unity_version >>
unity_license: << parameters.unity_license >>
- run:
name: Export unitypackage
command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
working_directory: .
- store_artifacts:
path: ./UniRx.Async.unitypackage
destination: /UniRx.Async.unitypackage
workflows:
version: 2
build-unity:
jobs:
- build-and-create-package:
unity_version: 2019.3.0a2
unity_license: ${UNITY_LICENSE_2019_3}
- build-and-test:
unity_version: 2019.3.0a2
unity_license: ${UNITY_LICENSE_2019_3}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,7 @@ UniRx\.Async\.Tests\.csproj
UniTask\.sln

RuntimeUnitTestToolkit\.csproj

Assembly-CSharp-Editor\.csproj

UniRx\.Async\.unitypackage
8 changes: 8 additions & 0 deletions Assets/Editor.meta

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

35 changes: 35 additions & 0 deletions Assets/Editor/PackageExporter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#if UNITY_EDITOR

using System;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;

public static class PackageExporter
{
[MenuItem("Tools/Export Unitypackage")]
public static void Export()
{
// configure
var root = "UniRx.Async";
var exportPath = "./UniRx.Async.unitypackage";

var path = Path.Combine(Application.dataPath, root);
var assets = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories)
.Where(x => Path.GetExtension(x) == ".cs" || Path.GetExtension(x) == ".asmdef" || Path.GetExtension(x) == ".json")
.Select(x => "Assets" + x.Replace(Application.dataPath, "").Replace(@"\", "/"))
.ToArray();

UnityEngine.Debug.Log("Export below files" + Environment.NewLine + string.Join(Environment.NewLine, assets));

AssetDatabase.ExportPackage(
assets,
exportPath,
ExportPackageOptions.Default);

UnityEngine.Debug.Log("Export complete: " + Path.GetFullPath(exportPath));
}
}

#endif
11 changes: 11 additions & 0 deletions Assets/Editor/PackageExporter.cs.meta

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

0 comments on commit aa33823

Please sign in to comment.