plus package

master
Yoshifumi Kawai 2019-05-20 02:12:11 +09:00
parent 20fea38bd7
commit aa33823a12
5 changed files with 85 additions and 17 deletions

View File

@ -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}

4
.gitignore vendored
View File

@ -141,3 +141,7 @@ UniRx\.Async\.Tests\.csproj
UniTask\.sln
RuntimeUnitTestToolkit\.csproj
Assembly-CSharp-Editor\.csproj
UniRx\.Async\.unitypackage

8
Assets/Editor.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 99c8676e874bf0343b421d3527868f16
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: af97405af79afbb4e9f7f49f30088474
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: