Skip to content

Commit

Permalink
Remove Java dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
evandixon committed Jan 13, 2020
1 parent 652a405 commit 8336abf
Show file tree
Hide file tree
Showing 17 changed files with 114 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Imports SkyEditor.Core.Projects
Imports SkyEditor.Core.Utilities
Imports SkyEditor.ROMEditor.ProcessManagement
Imports SkyEditor.ROMEditor.Projects
Imports SkyEditor.ROMEditor.Utilities
Imports SkyEditor.Utilities.AsyncFor

Namespace MysteryDungeon.PSMD.Projects
Expand Down Expand Up @@ -351,24 +352,19 @@ Namespace MysteryDungeon.PSMD.Projects

f.BatchSize = Environment.ProcessorCount * 2

Try
Using unluac As New UnluacManager
Await f.RunForEach(Directory.GetFiles(scriptSource, "*.lua", SearchOption.AllDirectories),
Async Function(item As String) As Task
Dim dest = item.Replace(scriptSource, scriptDestination)
If Not Directory.Exists(Path.GetDirectoryName(dest)) Then
Directory.CreateDirectory(Path.GetDirectoryName(dest))
End If

Await unluac.DecompileScript(item, dest)

File.Copy(dest, dest & ".original")
filesToOpen.Add(dest)
End Function)
End Using
Catch ex As JavaNotFoundException
ReportError(New ErrorInfo(Me) With {.Type = ErrorType.Error, .Message = My.Resources.Language.ProcessManagement_JavaNotFoundMessage})
End Try
Await f.RunForEach(Directory.GetFiles(scriptSource, "*.lua", SearchOption.AllDirectories),
Sub(item As String)
Dim dest = item.Replace(scriptSource, scriptDestination)
If Not Directory.Exists(Path.GetDirectoryName(dest)) Then
Directory.CreateDirectory(Path.GetDirectoryName(dest))
End If

Dim decompiledScript = LuaDecompiler.DecompileScript(File.ReadAllBytes(scriptSource))
File.WriteAllText(scriptDestination, decompiledScript)

File.Copy(dest, dest & ".original")
filesToOpen.Add(dest)
End Sub)

If AddScriptsToProject Then
For Each item In filesToOpen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<Reference Include="SkyEditor.Core, Version=4.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SkyEditor.Core.4.2.10\lib\net462\SkyEditor.Core.dll</HintPath>
</Reference>
<Reference Include="SkyEditor.IO, Version=5.0.8.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="SkyEditor.IO, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SkyEditor.IO.5.0.8\lib\net462\SkyEditor.IO.dll</HintPath>
</Reference>
<Reference Include="SkyEditor.SaveEditor, Version=4.2.1.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down Expand Up @@ -254,6 +254,7 @@
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Language.Designer.vb</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
Expand Down Expand Up @@ -333,6 +334,10 @@
<Project>{e92df34a-5cf0-4f9c-9640-a16b7453270d}</Project>
<Name>EveryFileExplorer</Name>
</ProjectReference>
<ProjectReference Include="..\SkyEditor.RomEditor.CSharp\SkyEditor.RomEditor.CSharp.csproj">
<Project>{48b3e8de-de58-4a1e-9b70-7cd53a739b4d}</Project>
<Name>SkyEditor.RomEditor.CSharp</Name>
</ProjectReference>
<ProjectReference Include="..\SkyEditor.ROMEditor\SkyEditor.ROMEditor.vbproj">
<Project>{f1b430d7-c00d-4673-8816-97c9df4376bc}</Project>
<Name>SkyEditor.ROMEditor</Name>
Expand Down
11 changes: 1 addition & 10 deletions SkyEditor.ROMEditor.Windows/Windows/Language.Designer.vb

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

3 changes: 0 additions & 3 deletions SkyEditor.ROMEditor.Windows/Windows/Language.resx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,4 @@ evandixon (Personality test, bgp files)</value>
<data name="SkyEditor_ROMEditor_MysteryDungeon_Rescue_Projects_BlueStarterModProject" xml:space="preserve">
<value>Starter Mod</value>
</data>
<data name="ProcessManagement_JavaNotFoundMessage" xml:space="preserve">
<value>Java could not be run on your system. Please ensure it's installed and accessible in the PATH environemnt variable.</value>
</data>
</root>
18 changes: 16 additions & 2 deletions SkyEditor.ROMEditor.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2024
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SkyEditor.ROMEditor.Windows", "SkyEditor.ROMEditor.Windows\SkyEditor.ROMEditor.Windows.vbproj", "{F05C12E8-EAB7-4B9E-A8D2-D21B80C1A646}"
EndProject
Expand Down Expand Up @@ -36,6 +36,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{924A8A27-C
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FarcFilenameHasher", "Misc\FarcFilenameHasher\FarcFilenameHasher.csproj", "{78E03B61-5B59-45B6-8388-F9F059199954}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyEditor.RomEditor.CSharp", "SkyEditor.RomEditor.CSharp\SkyEditor.RomEditor.CSharp.csproj", "{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -138,6 +140,18 @@ Global
{78E03B61-5B59-45B6-8388-F9F059199954}.Test|Any CPU.Build.0 = Debug|Any CPU
{78E03B61-5B59-45B6-8388-F9F059199954}.Test|x86.ActiveCfg = Debug|Any CPU
{78E03B61-5B59-45B6-8388-F9F059199954}.Test|x86.Build.0 = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Debug|x86.ActiveCfg = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Debug|x86.Build.0 = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Release|Any CPU.Build.0 = Release|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Release|x86.ActiveCfg = Release|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Release|x86.Build.0 = Release|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Test|Any CPU.ActiveCfg = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Test|Any CPU.Build.0 = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Test|x86.ActiveCfg = Debug|Any CPU
{48B3E8DE-DE58-4A1E-9B70-7CD53A739B4D}.Test|x86.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
11 changes: 1 addition & 10 deletions SkyEditor.ROMEditor/Language.Designer.vb

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

3 changes: 0 additions & 3 deletions SkyEditor.ROMEditor/Language.resx
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ evandixon (Personality test, bgp files)</value>
<data name="PluginName" xml:space="preserve">
<value>ROM Editor</value>
</data>
<data name="ProcessManagement_JavaNotFoundMessage" xml:space="preserve">
<value>Java could not be run on your system. Please ensure it's installed and accessible in the PATH environemnt variable.</value>
</data>
<data name="ProcessManagement_UnsuccessfulExitCodeExceptionMessage" xml:space="preserve">
<value>The program "{0}" exited with an unsuccessful exit code: {1}.</value>
</data>
Expand Down
33 changes: 0 additions & 33 deletions SkyEditor.ROMEditor/ProcessManagement/Java.vb

This file was deleted.

This file was deleted.

70 changes: 0 additions & 70 deletions SkyEditor.ROMEditor/ProcessManagement/UnluacManager.vb

This file was deleted.

28 changes: 0 additions & 28 deletions SkyEditor.ROMEditor/ProcessManagement/unluac.vb

This file was deleted.

4 changes: 4 additions & 0 deletions SkyEditor.ROMEditor/SkyEditor.ROMEditor.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<PackageReference Include="SkyEditor.SaveEditor" Version="4.2.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SkyEditor.RomEditor.CSharp\SkyEditor.RomEditor.CSharp.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Language.Designer.vb">
<DesignTime>True</DesignTime>
Expand Down
12 changes: 12 additions & 0 deletions SkyEditor.RomEditor.CSharp/SkyEditor.RomEditor.CSharp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;net472</TargetFrameworks>
<RootNamespace>SkyEditor.RomEditor</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="unluac.net" Version="1.1.5792.32599" />
</ItemGroup>

</Project>
Loading

0 comments on commit 8336abf

Please sign in to comment.