Переглянути джерело

build process added for UnityInjector

Scrublord1336 6 роки тому
батько
коміт
ff730eb92d

+ 3 - 0
CHANGELOG.md

@@ -1,3 +1,6 @@
+### 2.9.0
+ * FEATURE - Installation as UnityInjector plugin
+
 ### 2.8.0
  * CHANGE - Whether SSL is enabled or not is now entirely based on chosen endpoint support
  * FEATURE - Support for IMGUI translation texts with numbers

+ 17 - 1
README.md

@@ -1,4 +1,4 @@
-# XUnity Auto Translator
+# XUnity Auto Translator
 
 ## Text Frameworks
 This is an auto translation mod that hooks into the unity game engine and attempts to provide translations for the following text frameworks for Unity:
@@ -13,6 +13,7 @@ It does go to the internet, in order to provide the translation, so if you are n
 The mod can be installed into the following Plugin Managers:
  * [BepInEx](https://github.com/bbepis/BepInEx)
  * [IPA](https://github.com/Eusth/IPA)
+ * UnityInjector
 
 Installations instructions for both methods can be found below.
 
@@ -102,6 +103,21 @@ The file structure should like like this
 {GameDirectory}/Plugins/ExIni.dll
 {GameDirectory}/Plugins/Translation/AnyTranslationFile.txt (this files will be auto generated by plugin!)
  ```
+
+### UnityInjector Plugin
+REQUIRES: UnityInjector (follow its installation instructions first!).
+
+ 1. Download XUnity.AutoTranslator-UnityInjector-{VERSION}.zip from [releases](../../releases).
+ 2. Extract directly into the game directory, such that the plugin dlls are placed in UnityInjector folder. **This may not be game root directory!**
+
+The file structure should like like this
+```
+{GameDirectory}/UnityInjector/XUnity.AutoTranslator.Plugin.Core.dll
+{GameDirectory}/UnityInjector/XUnity.AutoTranslator.Plugin.Core.UnityInjector.dll
+{GameDirectory}/UnityInjector/0Harmony.dll
+{GameDirectory}/UnityInjector/ExIni.dll
+{GameDirectory}/UnityInjector/Translation/AnyTranslationFile.txt (this files will be auto generated by plugin!)
+ ```
  
 ### Standalone Installation (ReiPatcher)
 REQUIRES: Nothing, ReiPatcher is provided by this download.

+ 28 - 17
src/XUnity.AutoTranslator.Plugin.UnityInjector/XUnity.AutoTranslator.Plugin.UnityInjector.csproj

@@ -1,23 +1,34 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <TargetFramework>net35</TargetFramework>
-  </PropertyGroup>
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+      <Version>2.8.0</Version>
+   </PropertyGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
-  </ItemGroup>
+   <ItemGroup>
+      <ProjectReference Include="..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
 
-  <ItemGroup>
-    <Reference Include="ExIni">
-      <HintPath>..\..\libs\ExIni.dll</HintPath>
-    </Reference>
-    <Reference Include="UnityEngine">
-      <HintPath>..\..\libs\UnityEngine.dll</HintPath>
-    </Reference>
-    <Reference Include="UnityInjector">
-      <HintPath>..\..\libs\UnityInjector.dll</HintPath>
-    </Reference>
-  </ItemGroup>
+   <ItemGroup>
+      <Reference Include="ExIni">
+         <HintPath>..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityInjector">
+         <HintPath>..\..\libs\UnityInjector.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
+         <Output TaskParameter="Assemblies" ItemName="Targets" />
+      </GetAssemblyIdentity>
+      <ItemGroup>
+         <VersionNumber Include="$([System.Text.RegularExpressions.Regex]::Replace(&quot;%(Targets.Version)&quot;, &quot;^(.+?)(\.0+)$&quot;, &quot;$1&quot;))" />
+      </ItemGroup>
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)ExIni.dll&quot; &quot;$(SolutionDir)dist\UnityInjector\UnityInjector\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)0Harmony.dll&quot; &quot;$(SolutionDir)dist\UnityInjector\UnityInjector\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)Jurassic.dll&quot; &quot;$(SolutionDir)dist\UnityInjector\UnityInjector\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)XUnity.AutoTranslator.Plugin.Core.dll&quot; &quot;$(SolutionDir)dist\UnityInjector\UnityInjector\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\UnityInjector\UnityInjector\&quot;&#xD;&#xA;   powershell Compress-Archive -Path '$(SolutionDir)dist\UnityInjector\UnityInjector' -DestinationPath '$(SolutionDir)dist\UnityInjector\XUnity.AutoTranslator-UnityInjector-@(VersionNumber).zip' -Force)&#xD;&#xA;)" />
+   </Target>
 
 </Project>