Skip to content

Commit

Permalink
build for ksp 1.8-1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
haeena committed Feb 17, 2020
1 parent 0332cfb commit adf3a52
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 20 deletions.
4 changes: 2 additions & 2 deletions config.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
author = 'djungelorm'
version = '0.4.8'
ksp_version_max = '1.7.3.2594'
ksp_version_min = '1.2.2.1622'
ksp_version_max = '1.9.0.2781'
ksp_version_min = '1.8.0.2686'
ksp_version_max_parts = ksp_version_max.split('.')
ksp_version_min_parts = ksp_version_min.split('.')

Expand Down
9 changes: 9 additions & 0 deletions lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ exports_files ([
'ksp/KSP_Data/Managed/Assembly-CSharp.dll',
'ksp/KSP_Data/Managed/Assembly-CSharp-firstpass.dll',
'ksp/KSP_Data/Managed/UnityEngine.dll',
'ksp/KSP_Data/Managed/UnityEngine.AssetBundleModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.AnimationModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.CoreModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.IMGUIModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.InputLegacyModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.PhysicsModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.SharedInternalsModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.TextRenderingModule.dll',
'ksp/KSP_Data/Managed/UnityEngine.UI.dll',
'ksp/KSP_Data/Managed/UnityEngine.UIModule.dll',

'ksp/KSP_Data/Managed/mscorlib.dll',
'ksp/KSP_Data/Managed/System.dll',
Expand Down
4 changes: 4 additions & 0 deletions server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ deps = [
'//tools/build/ksp:Assembly-CSharp',
'//tools/build/ksp:Assembly-CSharp-firstpass',
'//tools/build/ksp:UnityEngine',
'//tools/build/ksp:UnityEngine.AnimationModule',
'//tools/build/ksp:UnityEngine.CoreModule',
'//tools/build/ksp:UnityEngine.IMGUIModule',
'//tools/build/ksp:UnityEngine.InputLegacyModule',
'//tools/build/ksp:UnityEngine.UI',
'//tools/build/ksp:mscorlib',
'//tools/build/ksp:System',
Expand Down
3 changes: 3 additions & 0 deletions server/src/Utils/Reflection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ static IEnumerable<Type> AllTypes ()
continue;
Type[] types;
try {
// FIXME: on 2nd pass or later, GetTypes start raising exception like below
// > Could not load type of field 'KRPC.Drawing.Text:mesh' (1) due to: Could not load file or assembly 'UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
// Workaround seems to load complaining assembly to this program.
types = assembly.GetTypes ();
} catch (ReflectionTypeLoadException exn) {
types = exn.Types.Where (x => x != null).ToArray ();
Expand Down
2 changes: 1 addition & 1 deletion service/Drawing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ csharp_library(

service_definitions(
name = 'ServiceDefinitions',
assemblies = [':KRPC.Drawing', '//service/UI:KRPC.UI', '//service/SpaceCenter:KRPC.SpaceCenter'],
assemblies = [':KRPC.Drawing', '//service/UI:KRPC.UI', '//service/SpaceCenter:KRPC.SpaceCenter', '//tools/build/ksp:UnityEngine.TextRenderingModule'],
service = 'Drawing',
out = 'KRPC.Drawing.json',
visibility = ['//visibility:public']
Expand Down
2 changes: 1 addition & 1 deletion service/UI/src/Addon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal static GameObject Instantiate (GameObject parent, string prefabName)
if (prefabs == null) {
var dir = System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location);
var path = System.IO.Path.Combine (dir, "KRPC.UI.ksp");
prefabs = new WWW ("file://" + path).assetBundle;
prefabs = AssetBundle.LoadFromFile ("file://" + path);
}
var prefab = prefabs.LoadAsset<GameObject> (prefabName);
var obj = Instantiate (prefab);
Expand Down
7 changes: 7 additions & 0 deletions service/build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ service_deps = [
'//tools/build/ksp:Assembly-CSharp',
'//tools/build/ksp:Assembly-CSharp-firstpass',
'//tools/build/ksp:UnityEngine',
'//tools/build/ksp:UnityEngine.AssetBundleModule',
'//tools/build/ksp:UnityEngine.AnimationModule',
'//tools/build/ksp:UnityEngine.CoreModule',
'//tools/build/ksp:UnityEngine.IMGUIModule',
'//tools/build/ksp:UnityEngine.PhysicsModule',
'//tools/build/ksp:UnityEngine.TextRenderingModule',
'//tools/build/ksp:UnityEngine.UI',
'//tools/build/ksp:UnityEngine.UIModule',
'//tools/build/ksp:mscorlib',
'//tools/build/ksp:System',
'//tools/build/ksp:System.Core',
Expand Down
10 changes: 10 additions & 0 deletions tools/ServiceDefinitions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ deps = [
'//tools/build/ksp:Assembly-CSharp',
'//tools/build/ksp:Assembly-CSharp-firstpass',
'//tools/build/ksp:UnityEngine',
'//tools/build/ksp:UnityEngine.AnimationModule',
'//tools/build/ksp:UnityEngine.CoreModule',
'//tools/build/ksp:UnityEngine.IMGUIModule',
'//tools/build/ksp:UnityEngine.InputLegacyModule',
'//tools/build/ksp:UnityEngine.UI',
'//tools/build/ksp:UnityEngine.SharedInternalsModule',
'//tools/build/ksp:KRPC.IO.Ports',
'//tools/build/mono-4.5:mscorlib',
'//tools/build/mono-4.5:System',
Expand Down Expand Up @@ -44,7 +49,12 @@ csharp_library(
'//tools/build/ksp:Assembly-CSharp',
'//tools/build/ksp:Assembly-CSharp-firstpass',
'//tools/build/ksp:UnityEngine',
'//tools/build/ksp:UnityEngine.AnimationModule',
'//tools/build/ksp:UnityEngine.CoreModule',
'//tools/build/ksp:UnityEngine.IMGUIModule',
'//tools/build/ksp:UnityEngine.InputLegacyModule',
'//tools/build/ksp:UnityEngine.UI',
'//tools/build/ksp:UnityEngine.SharedInternalsModule',
'//tools/build/ksp:KRPC.IO.Ports',
'//tools/build/mono-4.5:mscorlib',
'//tools/build/mono-4.5:System',
Expand Down
19 changes: 3 additions & 16 deletions tools/build-against-all-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,9 @@ mkdir -p bazel-bin/lib
pushd bazel-bin/lib

read -d '' versions << EOM || true
1.2.2.1622
1.3.0.1804
1.3.1.1891
1.4.0.2077
1.4.1.2089
1.4.2.2110
1.4.3.2152
1.4.4.2215
1.4.5.2243
1.5.0.2332
1.5.1.2335
1.6.1.2401
1.7.0.2483
1.7.1.2539
1.7.2.2556
1.7.3.2594
1.8.0.2686
1.8.1.2694
1.9.0.2781
EOM

# Save lib/ksp symlink
Expand Down
9 changes: 9 additions & 0 deletions tools/build/ksp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ load('//tools/build:csharp.bzl', 'csharp_reference')
package(default_visibility = ['//visibility:public'])

csharp_reference(name = 'UnityEngine', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.dll')
csharp_reference(name = 'UnityEngine.AssetBundleModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.AssetBundleModule.dll')
csharp_reference(name = 'UnityEngine.AnimationModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.AnimationModule.dll')
csharp_reference(name = 'UnityEngine.CoreModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.CoreModule.dll')
csharp_reference(name = 'UnityEngine.IMGUIModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.IMGUIModule.dll')
csharp_reference(name = 'UnityEngine.InputLegacyModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.InputLegacyModule.dll')
csharp_reference(name = 'UnityEngine.PhysicsModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.PhysicsModule.dll')
csharp_reference(name = 'UnityEngine.SharedInternalsModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.SharedInternalsModule.dll')
csharp_reference(name = 'UnityEngine.TextRenderingModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.TextRenderingModule.dll')
csharp_reference(name = 'UnityEngine.UI', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.UI.dll')
csharp_reference(name = 'UnityEngine.UIModule', file = '//lib:ksp/KSP_Data/Managed/UnityEngine.UIModule.dll')
csharp_reference(name = 'Assembly-CSharp', file = '//lib:ksp/KSP_Data/Managed/Assembly-CSharp.dll')
csharp_reference(name = 'Assembly-CSharp-firstpass', file = '//lib:ksp/KSP_Data/Managed/Assembly-CSharp-firstpass.dll')

Expand Down

0 comments on commit adf3a52

Please sign in to comment.