Browse Source

VS 2015 building project file

JoshEngebretson 10 years ago
parent
commit
56d7d39851

+ 5 - 6
Script/AtomicNET/AtomicNETProjects.json

@@ -12,8 +12,7 @@
       "assemblyName" : "AtomicNETBootstrap",
       "assemblyOutputPath" : "$ATOMIC_ROOT$/Artifacts/AtomicNET/TPA/",
       "references" : [
-        "System.Console", "System.Runtime" , "System.IO",  "System.IO.FileSystem",
-        "System.Collections", "System.Collections.Concurrent", "System.Linq"
+        "System.Runtime", "System.Collections", "System.Collections.Concurrent", "System.Linq"
       ],
       "sources" : [
         "$ATOMIC_ROOT$/Script/AtomicNET/AtomicNET/AtomicNETBootstrap/"
@@ -27,8 +26,7 @@
       "assemblyName" : "AtomicNETEngine",
       "assemblyOutputPath" : "$ATOMIC_ROOT$/Artifacts/AtomicNET/",
       "references" : [
-        "System.Console", "System.Runtime" , "System.IO",  "System.IO.FileSystem",
-        "System.Linq"
+        "System.Runtime" , "System.Linq"
       ],
       "sources" : [
         "$ATOMIC_ROOT$/Script/AtomicNET/AtomicNET/AtomicNETEngine/",
@@ -44,11 +42,12 @@
       "rootNamespace" : "AtomicTools",
       "assemblyName" : "AtomicNETTools",
       "assemblyOutputPath" : "$ATOMIC_ROOT$/Artifacts/AtomicNET/",
+      "assemblySearchPaths" : "$ATOMIC_ROOT$/Artifacts/AtomicNET/",
       "references" : [
-        "System.Console", "System.Runtime" , "System.IO",  "System.IO.FileSystem",
+        "System.Runtime" , "System.IO",
         "System.Reflection.Metadata", "System.Reflection.Primitives", "System.Collections.Immutable",
         "System.Linq",
-        "$ATOMIC_ROOT$/Artifacts/AtomicNET/AtomicNETEngine"
+        "AtomicNETEngine"
       ],
       "sources" : [
         "$ATOMIC_ROOT$/Script/AtomicNET/AtomicNET/AtomicNETTools/"

+ 8 - 9
Source/AtomicEditor/Application/AEPlayerApp.cpp

@@ -179,6 +179,14 @@ void AEPlayerApplication::Start()
     context_->RegisterSubsystem(new AtomicPlayer::Player(context_));
     AtomicPlayer::jsapi_init_atomicplayer(vm_);
 
+#ifdef ATOMIC_DOTNET
+    // Initialize Scripting Subsystem
+    NETScript* netScript = new NETScript(context_);
+    context_->RegisterSubsystem(netScript);
+    netScript->Initialize();
+    netScript->ExecMainAssembly();
+#endif
+
     if (!playerMode->launchedByEditor())
     {
         JSVM* vm = JSVM::GetJSVM(0);
@@ -189,15 +197,6 @@ void AEPlayerApplication::Start()
         }
     }
 
-#ifdef ATOMIC_DOTNET
-    // Initialize Scripting Subsystem
-    NETScript* netScript = new NETScript(context_);
-    context_->RegisterSubsystem(netScript);
-    netScript->Initialize();
-    netScript->ExecMainAssembly();
-#endif
-
-
     return;
 }
 

+ 10 - 0
Source/AtomicNET/NETCore/Platforms/Windows/NETHostWindows.cpp

@@ -27,6 +27,16 @@ NETHostWindows::~NETHostWindows()
 
 }
 
+int NETHostWindows::ExecAssembly(const String& assemblyName, const Vector<String>& args)
+{
+    return 0;
+}
+
+void NETHostWindows::Shutdown()
+{
+
+}
+
 bool NETHostWindows::CreateDelegate(const String& assemblyName, const String& qualifiedClassName, const String& methodName, void** funcOut)
 {
     if (!clrRuntimeHost_)

+ 3 - 2
Source/AtomicNET/NETCore/Platforms/Windows/NETHostWindows.h

@@ -64,11 +64,12 @@ public:
     virtual ~NETHostWindows();
 
     bool Initialize();
-
     bool CreateDelegate(const String& assemblyName, const String& qualifiedClassName, const String& methodName, void** funcOut);
-
     void WaitForDebuggerConnect();
 
+    int ExecAssembly(const String& assemblyName, const Vector<String>& args);
+    void Shutdown();
+
 private:
 
     bool LoadCLRDLL();

+ 4 - 0
Source/AtomicNET/NETRun/CMakeLists.txt

@@ -1,6 +1,10 @@
 include_directories (${CMAKE_SOURCE_DIR}/Source/ThirdParty/rapidjson/include
                      ${CMAKE_SOURCE_DIR}/Source/ThirdParty )
 
+if (MSVC)
+    add_definitions(-DATOMIC_WIN32_CONSOLE)
+endif()
+
 file (GLOB SOURCE_FILES *.cpp *.h)
 
 add_executable(NETRun ${SOURCE_FILES})

+ 1 - 1
Source/AtomicPlayer/Application/CMakeLists.txt

@@ -39,7 +39,7 @@ if (MSVC)
   COMMAND ${CMAKE_COMMAND}
   ARGS -E copy_if_different \"${D3DCOMPILER_47_DLL}\" \"$<TARGET_FILE_DIR:AtomicPlayer>/D3DCompiler_47.dll\")
 
-    target_link_libraries(AtomicPlayer NETCore)
+    target_link_libraries(AtomicPlayer NETCore NETScript)
 
 endif()
 

+ 0 - 2
Source/AtomicTool/CMakeLists.txt

@@ -50,8 +50,6 @@ elseif(APPLE)
 
 if (NOT IOS)
 
-
-
 add_custom_command(TARGET AtomicTool POST_BUILD
                    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Artifacts/AtomicNET/Build/
                    COMMAND $<TARGET_FILE:AtomicTool> net-projectgen "\"${CMAKE_SOURCE_DIR}/Script/AtomicNET/AtomicNETProjects.json\"" MACOSX

+ 1 - 1
Source/ToolCore/Assets/AssetDatabase.cpp

@@ -498,7 +498,7 @@ String AssetDatabase::GetResourceImporterName(const String& resourceTypeName)
         resourceTypeToImporterType_["Sprite2D"] = "TextureImporter";
         resourceTypeToImporterType_["AnimatedSprite2D"] = "SpriterImporter";
         resourceTypeToImporterType_["JSComponentFile"] = "JavascriptImporter";
-        resourceTypeToImporterType_["NETAssemblyFile"] = "NETAssemblyImporter";
+        resourceTypeToImporterType_["CSComponentAssembly"] = "NETAssemblyImporter";
         resourceTypeToImporterType_["ParticleEffect2D"] = "PEXImporter";
     }
 

+ 30 - 6
Source/ToolCore/NETTools/NETProjectGen.cpp

@@ -108,6 +108,22 @@ void NETCSProject::CreateReferencesItemGroup(XMLElement &projectRoot)
     }
 }
 
+void NETCSProject::GetAssemblySearchPaths(String& paths)
+{
+    paths.Clear();
+
+    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
+    const String& coreCLRAbsPath = tenv->GetNETCoreCLRAbsPath();
+
+    Vector<String> searchPaths;
+    searchPaths.Push(coreCLRAbsPath);
+
+    if (assemblySearchPaths_.Length())
+        searchPaths.Push(assemblySearchPaths_);
+
+    paths.Join(searchPaths, ";");
+}
+
 void NETCSProject::CreateReleasePropertyGroup(XMLElement &projectRoot)
 {
     XMLElement pgroup = projectRoot.CreateChild("PropertyGroup");
@@ -124,9 +140,10 @@ void NETCSProject::CreateReleasePropertyGroup(XMLElement &projectRoot)
     pgroup.CreateChild("NoConfig").SetValue("true");
     pgroup.CreateChild("NoCompilerStandardLib").SetValue("true");
 
-    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
-    const String& coreCLRAbsPath = tenv->GetNETCoreCLRAbsPath();
-    pgroup.CreateChild("AssemblySearchPaths").SetValue(coreCLRAbsPath);
+    String assemblySearchPaths;
+    GetAssemblySearchPaths(assemblySearchPaths);
+    pgroup.CreateChild("AssemblySearchPaths").SetValue(assemblySearchPaths);
+
 }
 
 void NETCSProject::CreateDebugPropertyGroup(XMLElement &projectRoot)
@@ -147,9 +164,9 @@ void NETCSProject::CreateDebugPropertyGroup(XMLElement &projectRoot)
     pgroup.CreateChild("NoConfig").SetValue("true");
     pgroup.CreateChild("NoCompilerStandardLib").SetValue("true");
 
-    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
-    const String& coreCLRAbsPath = tenv->GetNETCoreCLRAbsPath();
-    pgroup.CreateChild("AssemblySearchPaths").SetValue(coreCLRAbsPath);
+    String assemblySearchPaths;
+    GetAssemblySearchPaths(assemblySearchPaths);
+    pgroup.CreateChild("AssemblySearchPaths").SetValue(assemblySearchPaths);
 
 }
 
@@ -205,6 +222,10 @@ bool NETCSProject::Generate()
 
     project.CreateChild("Import").SetAttribute("Project", "$(MSBuildBinPath)\\Microsoft.CSharp.targets");
 
+    // on msbuild this seems to stop referencing of framework assemblies
+    project.CreateChild("Target").SetAttribute("Name", "GetReferenceAssemblyPaths");
+    project.CreateChild("Target").SetAttribute("Name", "GetFrameworkPaths");
+
     String projectSource = xmlFile_->ToString();
 
     NETSolution* solution = projectGen_->GetSolution();
@@ -228,6 +249,9 @@ bool NETCSProject::Load(const JSONValue& root)
     assemblyOutputPath_ = root["assemblyOutputPath"].GetString();
     ReplacePathStrings(assemblyOutputPath_);
 
+    assemblySearchPaths_ = root["assemblyOutputPath"].GetString();
+    ReplacePathStrings(assemblySearchPaths_);
+
     const JSONArray& references = root["references"].GetArray();
 
     for (unsigned i = 0; i < references.Size(); i++)

+ 2 - 0
Source/ToolCore/NETTools/NETProjectGen.h

@@ -60,6 +60,7 @@ private:
     void CreateMainPropertyGroup(XMLElement &projectRoot);
     void CreateDebugPropertyGroup(XMLElement &projectRoot);
     void CreateReleasePropertyGroup(XMLElement &projectRoot);
+    void GetAssemblySearchPaths(String& paths);
 
     String name_;
     String projectGuid_;
@@ -67,6 +68,7 @@ private:
     String rootNamespace_;
     String assemblyName_;
     String assemblyOutputPath_;
+    String assemblySearchPaths_;
 
     XMLElement xmlRoot_;