From b1533f2ec8d333c79f91df8fe10d27dd7a5f2ee0 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sun, 22 Oct 2023 17:36:55 -0500 Subject: [PATCH 01/41] Begin replacement of openjdk/build output. Build btclasses directory, using bootstrap JDK. Use tools for CharacterData and CharsetDecoder/Encoder. Much more to do. --- openjdk.props | 3 +- src/IKVM.Java/IKVM.Java.msbuildproj | 283 +++++++++++++++++++++++- src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs | 4 +- 3 files changed, 286 insertions(+), 4 deletions(-) diff --git a/openjdk.props b/openjdk.props index cee82ceadb..852106c631 100644 --- a/openjdk.props +++ b/openjdk.props @@ -11,8 +11,9 @@ - + + diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index be715ca3d1..6d04565f4e 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -63,7 +63,18 @@ - + + + + $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java')) + $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java.exe')) + -Xmx1536M + "$(JavaPath)" $(JavaArgs) + + + + + $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac')) @@ -150,4 +161,274 @@ + + + $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\jre\lib\rt.jar')) + + + + + + + $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\lib\tools.jar')) + + + + + + $(IntermediateOutputPath)btclasses.javac.rsp + $(IntermediateOutputPath)btclasses\ + $(BuildToolsOutputPath)btclasses.stamp + + + + + + + + + + + + <_BuildToolsJavaCompilerClasspath Include="$(ToolsJarPath)" /> + + + + <_BuildToolsJavaCompilerClasspathArg>@(_BuildToolsJavaCompilerClasspath, '$([System.IO.Path]::PathSeparator)') + <_BuildToolsJavaCompilerClasspathArg>$(_BuildToolsJavaCompilerClasspathArg.Replace('\', '\\')) + + + + <_BuildToolsJavaCompilerArgs Include="-cp" /> + <_BuildToolsJavaCompilerArgs Include=""$([MSBuild]::Escape('$(_BuildToolsJavaCompilerClasspathArg)'))"" /> + <_BuildToolsJavaCompilerArgs Include="-source" /> + <_BuildToolsJavaCompilerArgs Include="1.8" /> + <_BuildToolsJavaCompilerArgs Include="-target" /> + <_BuildToolsJavaCompilerArgs Include="1.8" /> + <_BuildToolsJavaCompilerArgs Include="-nowarn" /> + <_BuildToolsJavaCompilerArgs Include="-d" /> + <_BuildToolsJavaCompilerArgs Include="$(BuildToolsOutputPath)" /> + <_BuildToolsJavaCompilerArgs Include="@(BuildOpenJDKToolsSource->'%(FullPath)')" /> + + + + + + + + + + + + <_BuildToolsStartTime>$([System.DateTime]::Now.Ticks) + + + + + + + + <_BuildToolsStaleFiles Include="$(BuildToolsOutputPath)**\*.class" Condition=" '%(ModifiedTime)' == '' Or $([System.DateTime]::Parse('%(ModifiedTime)').Ticks) < $(_BuildToolsStartTime) " /> + + + + + + + <_BuildToolsStaleFiles Remove="@(_BuildToolsStaleFiles)" /> + + + + + + ResolveToolsJar; + BuildToolsResponseFile; + BuildTools; + $(BuildDependsOn); + + + + + $(IntermediateOutputPath)gensrc\ + + + + $(OpenJdkDir)jdk\make\data\characterdata\ + $(OpenJdkDir)jdk\make\data\unicodedata\ + + + + + + + + + + + + + + + + + + + <_TemplateArg>$(CharacterDataDir)%(CharacterDataItem.Identity).java.template + <_TemplateArg>$(_TemplateArg.Replace('\', '\\')) + <_SpecArg>$(UnicodeDataDir)UnicodeData.txt + <_SpecArg>$(_SpecArg.Replace('\', '\\')) + <_SpecialCasingArg>$(UnicodeDataDir)SpecialCasing.txt + <_SpecialCasingArg>$(_SpecialCasingArg.Replace('\', '\\')) + <_PropListArg>$(UnicodeDataDir)PropList.txt + <_PropListArg>$(_PropListArg.Replace('\', '\\')) + <_OutputArg>$(GenSrc)java\lang\%(CharacterDataItem.Identity).java + <_OutputArg>$(_OutputArg.Replace('\', '\\')) + + + + <_GenerateCharacterArgs Include="%(CharacterDataItem.Arg2)" /> + <_GenerateCharacterArgs Include="-template" /> + <_GenerateCharacterArgs Include="$(_TemplateArg)" /> + <_GenerateCharacterArgs Include="-spec" /> + <_GenerateCharacterArgs Include="$(_SpecArg)" /> + <_GenerateCharacterArgs Include="-specialcasing" /> + <_GenerateCharacterArgs Include="$(_SpecialCasingArg)" /> + <_GenerateCharacterArgs Include="-proplist" /> + <_GenerateCharacterArgs Include="$(_PropListArg)" /> + <_GenerateCharacterArgs Include="-o" /> + <_GenerateCharacterArgs Include="$(_OutputArg)" /> + <_GenerateCharacterArgs Include="-string" /> + <_GenerateCharacterArgs Include="-usecharforbyte" /> + <_GenerateCharacterArgs Include="%(CharacterDataItem.Arg3)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + GenerateCharacterData; + GenerateCharacterDataStatic; + $(BuildDependsOn); + + + + + <_GenerateCharsetDecoderTemplateFile Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\charset\Charset-X-Coder.java.template" OutputFile="$(GenSrc)java\nio\charset\CharsetDecoder.java" /> + <_GenerateCharsetEncoderTemplateFile Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\charset\Charset-X-Coder.java.template" OutputFile="$(GenSrc)java\nio\charset\CharsetEncoder.java" /> + + + + + + + + + <_GenerateCharsetDecoderArgs Include="-Kdecoder" /> + <_GenerateCharsetDecoderArgs Include="-DA="A"" /> + <_GenerateCharsetDecoderArgs Include="-Da="a"" /> + <_GenerateCharsetDecoderArgs Include="-DCode="Decode"" /> + <_GenerateCharsetDecoderArgs Include="-Dcode="decode"" /> + <_GenerateCharsetDecoderArgs Include="-DitypesPhrase="bytes in a specific charset"" /> + <_GenerateCharsetDecoderArgs Include="-DotypesPhrase="sixteen-bit Unicode characters"" /> + <_GenerateCharsetDecoderArgs Include="-Ditype="byte"" /> + <_GenerateCharsetDecoderArgs Include="-Dotype="character"" /> + <_GenerateCharsetDecoderArgs Include="-DItype="Byte"" /> + <_GenerateCharsetDecoderArgs Include="-DOtype="Char"" /> + <_GenerateCharsetDecoderArgs Include="-Dcoder="decoder"" /> + <_GenerateCharsetDecoderArgs Include="-DCoder="Decoder"" /> + <_GenerateCharsetDecoderArgs Include="-Dcoding="decoding"" /> + <_GenerateCharsetDecoderArgs Include="-DOtherCoder="Encoder"" /> + <_GenerateCharsetDecoderArgs Include="-DreplTypeName="string"" /> + <_GenerateCharsetDecoderArgs Include="-DdefaultRepl="\"\\uFFFD\""" /> + <_GenerateCharsetDecoderArgs Include="-DdefaultReplName="<tt>\"\\uFFFD\"</tt>"" /> + <_GenerateCharsetDecoderArgs Include="-DreplType="String"" /> + <_GenerateCharsetDecoderArgs Include="-DreplFQType="java.lang.String"" /> + <_GenerateCharsetDecoderArgs Include="-DreplLength="length()"" /> + <_GenerateCharsetDecoderArgs Include="-DItypesPerOtype="CharsPerByte"" /> + <_GenerateCharsetDecoderArgs Include="-DnotLegal="not legal for this charset"" /> + <_GenerateCharsetDecoderArgs Include="-Dotypes-per-itype="chars-per-byte"" /> + <_GenerateCharsetDecoderArgs Include="-DoutSequence="Unicode character"" /> + + + + + + + + + + + + + + + + + + + <_GenerateCharsetEncoderArgs Include="-Kencoder" /> + <_GenerateCharsetEncoderArgs Include="-DA="An"" /> + <_GenerateCharsetEncoderArgs Include="-Da="an"" /> + <_GenerateCharsetEncoderArgs Include="-DCode="Encode"" /> + <_GenerateCharsetEncoderArgs Include="-Dcode="encode"" /> + <_GenerateCharsetEncoderArgs Include="-DitypesPhrase="sixteen-bit Unicode characters"" /> + <_GenerateCharsetEncoderArgs Include="-DotypesPhrase="bytes in a specific charset"" /> + <_GenerateCharsetEncoderArgs Include="-Ditype="character"" /> + <_GenerateCharsetEncoderArgs Include="-Dotype="byte"" /> + <_GenerateCharsetEncoderArgs Include="-DItype="Char"" /> + <_GenerateCharsetEncoderArgs Include="-DOtype="Byte"" /> + <_GenerateCharsetEncoderArgs Include="-Dcoder="encoder"" /> + <_GenerateCharsetEncoderArgs Include="-DCoder="Encoder"" /> + <_GenerateCharsetEncoderArgs Include="-Dcoding="encoding"" /> + <_GenerateCharsetEncoderArgs Include="-DOtherCoder="Decoder"" /> + <_GenerateCharsetEncoderArgs Include="-DreplTypeName="byte array"" /> + <_GenerateCharsetEncoderArgs Include="-DdefaultRepl="new byte[] { (byte)'?' }"" /> + <_GenerateCharsetEncoderArgs Include="-DdefaultReplName="<tt>{</tt>\&nbsp%3B<tt>(byte)'?'</tt>\&nbsp%3B<tt>}</tt>"" /> + <_GenerateCharsetEncoderArgs Include="-DreplType="byte[]"" /> + <_GenerateCharsetEncoderArgs Include="-DreplFQType="byte[]"" /> + <_GenerateCharsetEncoderArgs Include="-DreplLength="length"" /> + <_GenerateCharsetEncoderArgs Include="-DItypesPerOtype="BytesPerChar"" /> + <_GenerateCharsetEncoderArgs Include="-DnotLegal="not a legal sixteen-bit Unicode sequence"" /> + <_GenerateCharsetEncoderArgs Include="-Dotypes-per-itype="bytes-per-char"" /> + <_GenerateCharsetEncoderArgs Include="-DoutSequence="byte sequence in the given charset"" /> + + + + + + + + + + + + + + + + GenerateCharsetDecoder; + GenerateCharsetEncoder; + $(BuildDependsOn); + + + diff --git a/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs b/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs index 53c145d0fa..23313109de 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs @@ -32,7 +32,7 @@ protected IkvmAsyncTask() : protected IkvmAsyncTask(ResourceManager taskResources) : base(taskResources) { - + cts = new CancellationTokenSource(); } /// @@ -43,7 +43,7 @@ protected IkvmAsyncTask(ResourceManager taskResources) : protected IkvmAsyncTask(ResourceManager taskResources, string helpKeywordPrefix) : base(taskResources, helpKeywordPrefix) { - + cts = new CancellationTokenSource(); } /// From a2f31689887f4ddf705644aea2b201548bf88358 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sun, 22 Oct 2023 20:19:03 -0500 Subject: [PATCH 02/41] Rename some variables. --- src/IKVM.Java/IKVM.Java.msbuildproj | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 6d04565f4e..db2e44b24a 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -240,12 +240,12 @@ - + ResolveToolsJar; BuildToolsResponseFile; BuildTools; - $(BuildDependsOn); - + $(CompileJavaDependsOn); + @@ -324,19 +324,19 @@ - + GenerateCharacterData; GenerateCharacterDataStatic; - $(BuildDependsOn); - + $(CompileJavaDependsOn); + - <_GenerateCharsetDecoderTemplateFile Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\charset\Charset-X-Coder.java.template" OutputFile="$(GenSrc)java\nio\charset\CharsetDecoder.java" /> - <_GenerateCharsetEncoderTemplateFile Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\charset\Charset-X-Coder.java.template" OutputFile="$(GenSrc)java\nio\charset\CharsetEncoder.java" /> + + - + @@ -370,39 +370,39 @@ - - + + - - + + - + <_GenerateCharsetEncoderArgs Include="-Kencoder" /> - <_GenerateCharsetEncoderArgs Include="-DA="An"" /> - <_GenerateCharsetEncoderArgs Include="-Da="an"" /> - <_GenerateCharsetEncoderArgs Include="-DCode="Encode"" /> - <_GenerateCharsetEncoderArgs Include="-Dcode="encode"" /> - <_GenerateCharsetEncoderArgs Include="-DitypesPhrase="sixteen-bit Unicode characters"" /> - <_GenerateCharsetEncoderArgs Include="-DotypesPhrase="bytes in a specific charset"" /> - <_GenerateCharsetEncoderArgs Include="-Ditype="character"" /> - <_GenerateCharsetEncoderArgs Include="-Dotype="byte"" /> - <_GenerateCharsetEncoderArgs Include="-DItype="Char"" /> - <_GenerateCharsetEncoderArgs Include="-DOtype="Byte"" /> - <_GenerateCharsetEncoderArgs Include="-Dcoder="encoder"" /> - <_GenerateCharsetEncoderArgs Include="-DCoder="Encoder"" /> - <_GenerateCharsetEncoderArgs Include="-Dcoding="encoding"" /> - <_GenerateCharsetEncoderArgs Include="-DOtherCoder="Decoder"" /> - <_GenerateCharsetEncoderArgs Include="-DreplTypeName="byte array"" /> - <_GenerateCharsetEncoderArgs Include="-DdefaultRepl="new byte[] { (byte)'?' }"" /> - <_GenerateCharsetEncoderArgs Include="-DdefaultReplName="<tt>{</tt>\&nbsp%3B<tt>(byte)'?'</tt>\&nbsp%3B<tt>}</tt>"" /> + <_GenerateCharsetEncoderArgs Include="-DA="An"" /> + <_GenerateCharsetEncoderArgs Include="-Da="an"" /> + <_GenerateCharsetEncoderArgs Include="-DCode="Encode"" /> + <_GenerateCharsetEncoderArgs Include="-Dcode="encode"" /> + <_GenerateCharsetEncoderArgs Include="-DitypesPhrase="sixteen-bit Unicode characters"" /> + <_GenerateCharsetEncoderArgs Include="-DotypesPhrase="bytes in a specific charset"" /> + <_GenerateCharsetEncoderArgs Include="-Ditype="character"" /> + <_GenerateCharsetEncoderArgs Include="-Dotype="byte"" /> + <_GenerateCharsetEncoderArgs Include="-DItype="Char"" /> + <_GenerateCharsetEncoderArgs Include="-DOtype="Byte"" /> + <_GenerateCharsetEncoderArgs Include="-Dcoder="encoder"" /> + <_GenerateCharsetEncoderArgs Include="-DCoder="Encoder"" /> + <_GenerateCharsetEncoderArgs Include="-Dcoding="encoding"" /> + <_GenerateCharsetEncoderArgs Include="-DOtherCoder="Decoder"" /> + <_GenerateCharsetEncoderArgs Include="-DreplTypeName="byte array"" /> + <_GenerateCharsetEncoderArgs Include="-DdefaultRepl="new byte[] { (byte)'?' }"" /> + <_GenerateCharsetEncoderArgs Include="-DdefaultReplName="<tt>{</tt>\&nbsp%3B<tt>(byte)'?'</tt>\&nbsp%3B<tt>}</tt>"" /> <_GenerateCharsetEncoderArgs Include="-DreplType="byte[]"" /> <_GenerateCharsetEncoderArgs Include="-DreplFQType="byte[]"" /> <_GenerateCharsetEncoderArgs Include="-DreplLength="length"" /> @@ -413,22 +413,22 @@ - - - + + + - - + + - + GenerateCharsetDecoder; GenerateCharsetEncoder; - $(BuildDependsOn); - + $(CompileJavaDependsOn); + From 9961aa866b4fe29d0829f63dfe06ada8ea0f3ff6 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 00:05:25 -0500 Subject: [PATCH 03/41] Generate mappings. --- openjdk.props | 2 +- src/IKVM.Java/IKVM.Java.msbuildproj | 83 ++++++++++++++++++++++++++--- 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/openjdk.props b/openjdk.props index 852106c631..8647fe9fd5 100644 --- a/openjdk.props +++ b/openjdk.props @@ -18,7 +18,7 @@ - + diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index db2e44b24a..e223c0da87 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -240,12 +240,12 @@ - + ResolveToolsJar; BuildToolsResponseFile; BuildTools; - $(CompileJavaDependsOn); - + $(GenerateSourceDependsOn); + @@ -324,11 +324,11 @@ - + GenerateCharacterData; GenerateCharacterDataStatic; - $(CompileJavaDependsOn); - + $(GenerateSourceDependsOn); + @@ -424,9 +424,78 @@ - + GenerateCharsetDecoder; GenerateCharsetEncoder; + $(GenerateSourceDependsOn); + + + + + $(OpenJdkDir)jdk\make\data\charsetmapping\ + $(OpenJdkDir)jdk\make\src\classes\build\tools\charsetmapping\ + + + + + + + + + + + + + + + + + + + + + + + <_GenerateCharsetMappingArgs Include="%(GenerateCharsetMappingItem.Source)" /> + <_GenerateCharsetMappingArgs Include="%(GenerateCharsetMappingItem.Destination)" /> + <_GenerateCharsetMappingArgs Include="%(GenerateCharsetMappingItem.Identity)" /> + <_GenerateCharsetMappingArgs Include="%(GenerateCharsetMappingItem.Copyright)" Condition=" '%(GenerateCharsetMappingItem.Copyright)' != '' " /> + + + + + + + + + + + + + + + GenerateCharsetMapping; + GenerateStandardCharsets; + $(GenerateSourceDependsOn); + + + + + + $(GenerateSourceDependsOn); + + + + + + + + + + + + + GenerateSource; $(CompileJavaDependsOn); From 835088dd0942021f0120d3ec899fea57ede6e09f Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 16:19:20 -0500 Subject: [PATCH 04/41] Add new tasks to execute commands on WSL or Unix shells. Add standardcharsets generation. --- openjdk.props | 1 - src/IKVM.Java/IKVM.Java.msbuildproj | 151 +++++++++++- src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs | 8 + src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 257 +++++++++++++++++++++ src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 96 ++++++++ src/IKVM.Tests.Util/IKVM.Tests.Util.csproj | 2 +- 6 files changed, 504 insertions(+), 11 deletions(-) create mode 100644 src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs create mode 100644 src/IKVM.MSBuild.Tasks/IkvmWslPath.cs diff --git a/openjdk.props b/openjdk.props index 8647fe9fd5..b73e634c0a 100644 --- a/openjdk.props +++ b/openjdk.props @@ -18,7 +18,6 @@ - diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index e223c0da87..4d6c12690e 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -17,6 +17,10 @@ + + + + @@ -211,6 +215,10 @@ <_BuildToolsJavaCompilerArgs Include="@(BuildOpenJDKToolsSource->'%(FullPath)')" /> + + + + @@ -237,6 +245,11 @@ <_BuildToolsStaleFiles Remove="@(_BuildToolsStaleFiles)" /> + + + + + @@ -267,7 +280,7 @@ - + @@ -318,7 +331,6 @@ - @@ -336,7 +348,7 @@ - + @@ -374,12 +386,11 @@ - - + @@ -418,7 +429,6 @@ - @@ -450,7 +460,7 @@ - + @@ -466,10 +476,101 @@ + + + + + - - + + + + + + + + + + <_Script>$(OpenJdkDir)jdk\make\scripts\genCharsetProvider.sh + <_TempDir>$(IntermediateOutputPath)GenerateStandardCharsets.dir + <_JavaExe>$(JavaPath) + <_ScriptDir>$(OpenJdkDir)jdk\make\scripts\ + <_StandardCharsetsFile>$(OpenJdkDir)jdk\src\share\classes\sun\nio\cs\standard-charsets + <_DestinationDir>$(GenSrc)sun\nio\cs\ + <_Hasher>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)GenerateStandardCharsets.hasher.sh')) + <_BuildToolsOutputPath>$([System.IO.Path]::GetFullPath('$(BuildToolsOutputPath)')) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_GenerateStandardCharsetsEnv Include="CLASSPATH" Value="$(_BuildToolsOutputPath)" /> + <_GenerateStandardCharsetsEnv Include="NAWK" Value="nawk" /> + <_GenerateStandardCharsetsEnv Include="TEMPDIR" Value="$(_TempDir)" /> + <_GenerateStandardCharsetsEnv Include="HASHER" Value="sh -e $(_Hasher)" /> + <_GenerateStandardCharsetsEnv Include="SCRIPTS" Value="$(_ScriptDir)" /> + + + + <_GenerateStandardCharsetsArg Include="-e" /> + <_GenerateStandardCharsetsArg Include="$(_Script)" /> + <_GenerateStandardCharsetsArg Include="$(_StandardCharsetsFile)" /> + <_GenerateStandardCharsetsArg Include="$(_DestinationDir)" /> + + + + + + + + + + @@ -500,4 +601,36 @@ + + <___IkvmAsyncTaskCs>$([System.IO.File]::ReadAllText('$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', '..', 'IKVM.MSBuild.Tasks', 'IkvmAsyncTask.cs'))')) + <___IkvmWslPathCs>$([System.IO.File]::ReadAllText('$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', '..', 'IKVM.MSBuild.Tasks', 'IkvmWslPath.cs'))')) + <___IkvmUnixExecCs>$([System.IO.File]::ReadAllText('$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', '..', 'IKVM.MSBuild.Tasks', 'IkvmUnixExec.cs'))')) + <___CliWrapDll Condition=" '$(MSBuildRuntimeType)' == 'Core' And '$(PkgCliWrap)' != '' ">$(PkgCliWrap)\lib\netcoreapp3.0\CliWrap.dll + <___CliWrapDll Condition=" '$(MSBuildRuntimeType)' != 'Core' And '$(PkgCliWrap)' != '' ">$(PkgCliWrap)\lib\net461\CliWrap.dll + + + + + + + + + + + + + + + + + + + + diff --git a/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs b/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs index 23313109de..6d0f176d5f 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmAsyncTask.cs @@ -46,6 +46,11 @@ protected IkvmAsyncTask(ResourceManager taskResources, string helpKeywordPrefix) cts = new CancellationTokenSource(); } + /// + /// Gets the working directory the task was started with. Since this is an async task, async operations may resume after the working directory has changed. + /// + protected string CurrentWorkingDirectory { get; private set; } + /// /// Executes the task. /// @@ -55,6 +60,9 @@ public override bool Execute() if (cts.IsCancellationRequested) return false; + // save current working directory + CurrentWorkingDirectory = Environment.CurrentDirectory; + // wait for result, and ensure we reacquire in case of return value or exception Task run; diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs new file mode 100644 index 0000000000..7f33a1ca0a --- /dev/null +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -0,0 +1,257 @@ +namespace IKVM.MSBuild.Tasks +{ + + using System.Collections.Generic; + using System.Resources; + using System.Runtime.InteropServices; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + + using CliWrap; + using CliWrap.Builders; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// Task to execute a Unix shell script. + /// + public class IkvmUnixExec : IkvmAsyncTask + { + + /// + /// Script to be run on a Unix shell. + /// + [Required] + public string Command { get; set; } + + /// + /// Optionally, additional arguments to add to the command. If empty, the Command will be treated as a single command line. + /// + public ITaskItem[] Arguments { get; set; } + + /// + /// If on Windows, allow WSL to be used. Paths and commands need to be previously converted to Unix paths. + /// + public bool UseWsl { get; set; } = true; + + /// + /// Optionally the distribution to use. + /// + public string WslDistribution { get; set; } + + /// + /// Path to the working directory. + /// + public string WorkingDirectory { get; set; } + + /// + /// Gets the set of environmental variables to apply. Each ItemSpec represents a name, with the Value metadata representing a value. + /// + public ITaskItem[] EnvironmentVariables { get; set; } + + /// + /// Whether or not to capture the standard output of the command. + /// + public bool RedirectStandardOutput { get; set; } = false; + + /// + /// Whether or not to log standard output of the command. + /// + public bool LogStandardOutput { get; set; } = true; + + /// + /// Whether or not to capture the standard error of the command. + /// + public bool RedirectStandardError { get; set; } = false; + + /// + /// Whether or not to log standard error of the command. + /// + public bool LogStandardError { get; set; } = true; + + /// + /// Lines to provide as standard input to the command. + /// + public List StandardInput { get; set; } + + /// + /// Resulting standard output lines. + /// + [Output] + public List StandardOutput { get; set; } + + /// + /// Resulting standard error lines. + /// + [Output] + public List StandardError { get; set; } + + /// + /// Initializes a new instance. + /// + public IkvmUnixExec() + { + + } + + /// + /// Initializes a new instance. + /// + /// + public IkvmUnixExec(ResourceManager taskResources) : + base(taskResources) + { + + } + + /// + /// Initializes a new instance. + /// + /// + /// + public IkvmUnixExec(ResourceManager taskResources, string helpKeywordPrefix) : + base(taskResources, helpKeywordPrefix) + { + + } + + /// + /// Executes the task. + /// + /// + /// + protected override async Task ExecuteAsync(CancellationToken cancellationToken) + { + // clear output lists + StandardOutput = new List(); + StandardError = new List(); + + // execute with wsl.exe + var cli = BuildCommand(); + + // add standard input to the command + if (StandardInput != null) + { + // collect standard input lines as a single string + var stdin = new StringBuilder(); + foreach (var i in StandardInput) + stdin.AppendLine(i.ItemSpec); + + // add final string to command + cli = cli.WithStandardInputPipe(PipeSource.FromString(stdin.ToString())); + } + + // capture standard output to output list + var stdout = new List(); + if (RedirectStandardOutput) + stdout.Add(PipeTarget.ToDelegate(s => StandardOutput.Add(new TaskItem(s)))); + if (LogStandardOutput) + stdout.Add(PipeTarget.ToDelegate(s => Log.LogMessage(s))); + if (stdout.Count == 1) + cli = cli.WithStandardOutputPipe(stdout[0]); + if (stdout.Count >= 2) + cli = cli.WithStandardOutputPipe(PipeTarget.Merge(stdout)); + + // capture standard error to output list + var stderr = new List(); + if (RedirectStandardError) + stderr.Add(PipeTarget.ToDelegate(s => StandardError.Add(new TaskItem(s)))); + if (LogStandardError) + stderr.Add(PipeTarget.ToDelegate(s => Log.LogError(s))); + if (stderr.Count == 1) + cli = cli.WithStandardErrorPipe(stderr[0]); + if (stderr.Count >= 2) + cli = cli.WithStandardErrorPipe(PipeTarget.Merge(stderr)); + + // log the final command line + Log.LogMessage(MessageImportance.High, cli.ToString()); + + // log the environment variables being passed + if (cli.EnvironmentVariables.Count > 0) + { + var s = new StringBuilder(); + foreach (var env in cli.EnvironmentVariables) + s.AppendLine($"ENV {env.Key}={env.Value}"); + + Log.LogMessage(MessageImportance.High, s.ToString()); + } + + // execute executable + var exe = await cli.ExecuteAsync(cancellationToken); + if (exe.ExitCode != 0) + { + Log.LogError("Non-zero exit code running Unix command: {0}", exe.ExitCode); + return false; + } + + return true; + } + + /// + /// Builds a new command. + /// + /// + Command BuildCommand() + { + var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap("wsl.exe").WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); + cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables).WithValidation(CommandResultValidation.None); + cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); + return cmd; + } + + /// + /// Builds the arguments to execute. + /// + /// + void BuildWslArguments(ArgumentsBuilder builder) + { + if (WslDistribution != null) + builder.Add("-d").Add(WslDistribution); + + builder.Add("--"); + builder.Add(Command); + BuildArguments(builder); + } + + /// + /// Builds the arguments to execute. + /// + /// + void BuildArguments(ArgumentsBuilder builder) + { + if (Arguments != null) + foreach (var i in Arguments) + builder.Add(i.ItemSpec); + } + + /// + /// Builds the environment variables. + /// + /// + void BuildEnvironmentVariables(EnvironmentVariablesBuilder builder) + { + if (EnvironmentVariables == null) + return; + + foreach (var env in EnvironmentVariables) + if (env.ItemSpec != null) + builder.Set(env.ItemSpec, env.GetMetadata("Value") ?? ""); + + // WSL requires a WSLENV variable to determine which values pass to the process + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl) + { + // record each variable + var wslenv = new List(); + foreach (var env in EnvironmentVariables) + if (env.ItemSpec != null) + wslenv.Add(env.ItemSpec); + + builder.Set("WSLENV", string.Join(":", wslenv)); + } + } + + } + +} diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs new file mode 100644 index 0000000000..220499b194 --- /dev/null +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -0,0 +1,96 @@ +namespace IKVM.MSBuild.Tasks +{ + using System.Resources; + using System.Threading; + using System.Threading.Tasks; + + using CliWrap; + using CliWrap.Builders; + + using Microsoft.Build.Framework; + + /// + /// Task to convert a Windows path to a WSL path. + /// + public class IkvmWslPath : IkvmAsyncTask + { + + /// + /// Path to convert. + /// + [Required] + [Output] + public string Path { get; set; } + + /// + /// Optional name of the distro to use. + /// + public string Distribution { get; set; } + + /// + /// Initializes a new instance. + /// + public IkvmWslPath() + { + + } + + /// + /// Initializes a new instance. + /// + /// + public IkvmWslPath(ResourceManager taskResources) : + base(taskResources) + { + + } + + /// + /// Initializes a new instance. + /// + /// + /// + public IkvmWslPath(ResourceManager taskResources, string helpKeywordPrefix) : + base(taskResources, helpKeywordPrefix) + { + + } + + /// + /// Executes the task. + /// + /// + protected override async Task ExecuteAsync(CancellationToken cancellationToken) + { + var cli = Cli.Wrap("wsl.exe").WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); + Log.LogCommandLine(cli.ToString()); + var exe = await cli.ExecuteAsync(cancellationToken); + return true; + } + + /// + /// Attempts to set the path. + /// + /// + void TrySetPath(string arg) + { + if (string.IsNullOrWhiteSpace(arg) == false) + Path = arg; + } + + /// + /// Adds the arguments for 'wslpath'. + /// + /// + void AddArguments(ArgumentsBuilder builder) + { + if (Distribution != null) + builder.Add("-d").Add(Distribution); + + builder.Add("wslpath"); + builder.Add(Path.Replace("\\", "\\\\"), true); + } + + } + +} diff --git a/src/IKVM.Tests.Util/IKVM.Tests.Util.csproj b/src/IKVM.Tests.Util/IKVM.Tests.Util.csproj index 8d2868e21c..4cd4354d27 100644 --- a/src/IKVM.Tests.Util/IKVM.Tests.Util.csproj +++ b/src/IKVM.Tests.Util/IKVM.Tests.Util.csproj @@ -4,7 +4,7 @@ - + From 1dac49a7863176fa7781a556da7f6a56bb4451c2 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 17:36:27 -0500 Subject: [PATCH 05/41] Add WSL back for Unix tools. --- .github/workflows/IKVM.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index 0819a8b06c..8e3c6bf25b 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -145,6 +145,9 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x + - name: Setup WSL + if: runner.os == 'Windows' + uses: Vampire/setup-wsl@v2 - name: Cache LLVM and Clang id: cache-llvm uses: actions/cache@v3 From 69af99a2bc36301492a0748ad6abece287f0b6a8 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 20:22:35 -0500 Subject: [PATCH 06/41] Adjust log level for errors to warning. --- src/IKVM.Java/IKVM.Java.msbuildproj | 4 +-- src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 35 ++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 4d6c12690e..8865b7f692 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -483,7 +483,7 @@ - + @@ -563,7 +563,7 @@ <_GenerateStandardCharsetsArg Include="$(_DestinationDir)" /> - + diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs index 7f33a1ca0a..17ccbc5111 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -61,6 +61,11 @@ public class IkvmUnixExec : IkvmAsyncTask /// public bool LogStandardOutput { get; set; } = true; + /// + /// Log level at which to emit standard output messages. + /// + public string StandardOutputLogLevel { get; set; } + /// /// Whether or not to capture the standard error of the command. /// @@ -71,6 +76,11 @@ public class IkvmUnixExec : IkvmAsyncTask /// public bool LogStandardError { get; set; } = true; + /// + /// Log level at which to emit standard error messages. + /// + public string StandardErrorLogLevel { get; set; } + /// /// Lines to provide as standard input to the command. /// @@ -148,7 +158,7 @@ protected override async Task ExecuteAsync(CancellationToken cancellationT if (RedirectStandardOutput) stdout.Add(PipeTarget.ToDelegate(s => StandardOutput.Add(new TaskItem(s)))); if (LogStandardOutput) - stdout.Add(PipeTarget.ToDelegate(s => Log.LogMessage(s))); + stdout.Add(PipeTarget.ToDelegate(s => LogWithLevel(StandardOutputLogLevel, s))); if (stdout.Count == 1) cli = cli.WithStandardOutputPipe(stdout[0]); if (stdout.Count >= 2) @@ -159,7 +169,7 @@ protected override async Task ExecuteAsync(CancellationToken cancellationT if (RedirectStandardError) stderr.Add(PipeTarget.ToDelegate(s => StandardError.Add(new TaskItem(s)))); if (LogStandardError) - stderr.Add(PipeTarget.ToDelegate(s => Log.LogError(s))); + stderr.Add(PipeTarget.ToDelegate(s => LogWithLevel(StandardErrorLogLevel, s))); if (stderr.Count == 1) cli = cli.WithStandardErrorPipe(stderr[0]); if (stderr.Count >= 2) @@ -189,6 +199,27 @@ protected override async Task ExecuteAsync(CancellationToken cancellationT return true; } + /// + /// Logs the specified message at the given level. + /// + /// + /// + void LogWithLevel(string level, string message) + { + switch (level) + { + case "Warning": + Log.LogWarning(message); + break; + case "Error": + Log.LogError(message); + break; + default: + Log.LogMessage(message); + break; + } + } + /// /// Builds a new command. /// From d25c02334a40db697975ea0c79f181ad7cfc4c5b Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 20:29:37 -0500 Subject: [PATCH 07/41] Use full path to WSL.exe. Might not work on WSL1? --- src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs index 17ccbc5111..df450a1d83 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -1,6 +1,6 @@ namespace IKVM.MSBuild.Tasks { - + using System; using System.Collections.Generic; using System.Resources; using System.Runtime.InteropServices; @@ -226,7 +226,7 @@ void LogWithLevel(string level, string message) /// Command BuildCommand() { - var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap("wsl.exe").WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); + var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap(Environment.ExpandEnvironmentVariables("%SystemRoot%\\System32\\wsl.exe")).WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables).WithValidation(CommandResultValidation.None); cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); return cmd; From 6046d5b27df0da31204aa9210c7aebccce9998c8 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 20:54:28 -0500 Subject: [PATCH 08/41] Use build tools files as input. --- src/IKVM.Java/IKVM.Java.msbuildproj | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 8865b7f692..784296e564 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -247,6 +247,7 @@ + @@ -280,7 +281,7 @@ - + @@ -348,7 +349,7 @@ - + @@ -390,7 +391,7 @@ - + @@ -460,7 +461,7 @@ - + @@ -483,7 +484,7 @@ - + From 4a95ca64cd81a7af1fb5b81fc517a7c34477ac57 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 21:01:29 -0500 Subject: [PATCH 09/41] Move build tools stamp file. --- src/IKVM.Java/IKVM.Java.msbuildproj | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 784296e564..c312436228 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -182,7 +182,7 @@ $(IntermediateOutputPath)btclasses.javac.rsp $(IntermediateOutputPath)btclasses\ - $(BuildToolsOutputPath)btclasses.stamp + $(IntermediateOutputPath)BuildTools.stamp @@ -264,8 +264,13 @@ $(IntermediateOutputPath)gensrc\ + $(OpenJdkDir)jdk\make\scripts\ + + + + $(OpenJdkDir)jdk\make\data\characterdata\ $(OpenJdkDir)jdk\make\data\unicodedata\ @@ -476,7 +481,7 @@ - + @@ -484,7 +489,7 @@ - + @@ -493,10 +498,10 @@ - <_Script>$(OpenJdkDir)jdk\make\scripts\genCharsetProvider.sh + <_Script>$(GenSrcScriptsDir)genCharsetProvider.sh <_TempDir>$(IntermediateOutputPath)GenerateStandardCharsets.dir <_JavaExe>$(JavaPath) - <_ScriptDir>$(OpenJdkDir)jdk\make\scripts\ + <_ScriptDir>$(GenSrcScriptsDir) <_StandardCharsetsFile>$(OpenJdkDir)jdk\src\share\classes\sun\nio\cs\standard-charsets <_DestinationDir>$(GenSrc)sun\nio\cs\ <_Hasher>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)GenerateStandardCharsets.hasher.sh')) From b31e946be6204387219fdd177c61b2be26a85797 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 23 Oct 2023 22:28:58 -0500 Subject: [PATCH 10/41] Fix dir variables. --- src/IKVM.Java/IKVM.Java.msbuildproj | 70 ++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index c312436228..3e84304ba8 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -264,11 +264,12 @@ $(IntermediateOutputPath)gensrc\ - $(OpenJdkDir)jdk\make\scripts\ + $(IntermediateOutputPath)genlib\ + $(OpenJdkDir)jdk\make\scripts\ - + @@ -489,7 +490,7 @@ - + @@ -498,10 +499,10 @@ - <_Script>$(GenSrcScriptsDir)genCharsetProvider.sh + <_Script>$(BuildScriptsDir)genCharsetProvider.sh <_TempDir>$(IntermediateOutputPath)GenerateStandardCharsets.dir <_JavaExe>$(JavaPath) - <_ScriptDir>$(GenSrcScriptsDir) + <_ScriptDir>$(BuildScriptsDir) <_StandardCharsetsFile>$(OpenJdkDir)jdk\src\share\classes\sun\nio\cs\standard-charsets <_DestinationDir>$(GenSrc)sun\nio\cs\ <_Hasher>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)GenerateStandardCharsets.hasher.sh')) @@ -587,6 +588,50 @@ + + + + + + + <_DtdHome>$(OpenJdkDir)jdk\make\data\dtdbuilder + + + + + + + + + + + GenerateHtml32DTD; + $(GenerateSourceDependsOn); + + + + + + + + + + <_DtdHome>$(OpenJdkDir)jdk\make\data\dtdbuilder + + + + + + + + + + + GenerateCaCerts; + $(GenerateLibDependsOn); + + + $(GenerateSourceDependsOn); @@ -596,13 +641,26 @@ - + + + + + + + $(GenerateDataDependsOn); + + + + + + GenerateSource; + GenerateData; $(CompileJavaDependsOn); From 644eeebf5f304bf620f6068b3f7244814f40504f Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Tue, 24 Oct 2023 10:06:35 -0500 Subject: [PATCH 11/41] Adding more deps. --- src/IKVM.Java/IKVM.Java.msbuildproj | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 3e84304ba8..b1e4e6a55d 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -610,26 +610,17 @@ - + - - - <_DtdHome>$(OpenJdkDir)jdk\make\data\dtdbuilder - - - - - - - + GenerateCaCerts; - $(GenerateLibDependsOn); - + $(GenerateDataDependsOn); + @@ -653,7 +644,7 @@ - + From 466e34ecb1aa931a6b7e291509bc6378905d3685 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Tue, 24 Oct 2023 13:47:23 -0500 Subject: [PATCH 12/41] Add GenerateExceptions, remove existing generated files from input. --- openjdk.props | 1 + src/IKVM.Java/IKVM.Java.msbuildproj | 66 ++++++++++++++++++++++++++--- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/openjdk.props b/openjdk.props index b73e634c0a..9da91bc8cd 100644 --- a/openjdk.props +++ b/openjdk.props @@ -12,6 +12,7 @@ + diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index b1e4e6a55d..ea9fe09f31 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -76,6 +76,7 @@ "$(JavaPath)" $(JavaArgs) + @@ -87,6 +88,7 @@ "$(JavaCompilerPath)" $(JavaCompilerArgs) + @@ -104,6 +106,7 @@ "$(RmiCompilerPath)" $(RmiCompilerArgs) + @@ -170,6 +173,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\jre\lib\rt.jar')) + @@ -177,6 +181,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\lib\tools.jar')) + @@ -609,16 +614,67 @@ $(GenerateSourceDependsOn); + + + + + + - - - - + + + <_Script>$(BuildScriptsDir)genExceptions.sh + <_Scripts>$(BuildScriptsDir) + <_Exceptions>$(OpenJdkDir)jdk\src\share\classes\java\nio\%(GenerateExceptionsItem.Identity)\exceptions + <_DestinationDir>$(GenSrc)java\nio\%(GenerateExceptionsItem.Identity) + + + + + + + + + + + + + + + + + + + + <_GenerateExceptionsEnv Include="SCRIPTS" Value="$(_Scripts)" /> + <_GenerateExceptionsEnv Include="NAWK" Value="nawk" /> + + + + <_GenerateExceptionsArg Include="-e" /> + <_GenerateExceptionsArg Include="$(_Script)" /> + <_GenerateExceptionsArg Include="$(_Exceptions)" /> + <_GenerateExceptionsArg Include="$(_DestinationDir)" /> + + + + + + + + + + + + GenerateExceptions; + $(GenerateSourceDependsOn); + + + - GenerateCaCerts; $(GenerateDataDependsOn); From 177e1417bc6a0e2574858d6587a132baa9f378ce Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Tue, 24 Oct 2023 18:12:17 -0500 Subject: [PATCH 13/41] Use full path. --- src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs index 220499b194..eae3881670 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -1,5 +1,6 @@ namespace IKVM.MSBuild.Tasks { + using System; using System.Resources; using System.Threading; using System.Threading.Tasks; @@ -62,7 +63,7 @@ public IkvmWslPath(ResourceManager taskResources, string helpKeywordPrefix) : /// protected override async Task ExecuteAsync(CancellationToken cancellationToken) { - var cli = Cli.Wrap("wsl.exe").WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); + var cli = Cli.Wrap(Environment.ExpandEnvironmentVariables("%SystemRoot%\\System32\\wsl.exe")).WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); Log.LogCommandLine(cli.ToString()); var exe = await cli.ExecuteAsync(cancellationToken); return true; From 8390cf27b23ed54288eeadca1970df09caa3bb23 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Tue, 24 Oct 2023 22:43:03 -0500 Subject: [PATCH 14/41] Write GenBufferSetup in C#. Works. --- openjdk.props | 4 - src/IKVM.Java/IKVM.Java.msbuildproj | 374 +++++++++++++++++++++++++++- 2 files changed, 373 insertions(+), 5 deletions(-) diff --git a/openjdk.props b/openjdk.props index 9da91bc8cd..e60fd61492 100644 --- a/openjdk.props +++ b/openjdk.props @@ -11,10 +11,6 @@ - - - - diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index ea9fe09f31..bfd63be782 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -614,7 +614,7 @@ $(GenerateSourceDependsOn); - + @@ -673,6 +673,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (); + args.Add($"-Dtype={kv["type"]}"); + args.Add($"-DType={kv["Type"]}"); + args.Add($"-Dfulltype={kv["fulltype"]}"); + args.Add($"-Dmemtype={kv["memtype"]}"); + args.Add($"-DMemtype={kv["Memtype"]}"); + args.Add($"-DfromBits={kv["fromBits"]}"); + args.Add($"-DtoBits={kv["toBits"]}"); + args.Add($"-DLG_BYTES_PER_VALUE={kv["LBPV"]}"); + args.Add($"-DBYTES_PER_VALUE=\"{(1 << int.Parse((string)kv["LBPV"]))}\""); + args.Add($"-Dnbytes={kv["nbytes"]}"); + args.Add($"-DnbytesButOne={kv["nbytesButOne"]}"); + args.Add($"-DRW={kv["RW"]}"); + args.Add($"-K{kv["rwkey"]}"); + args.Add($"-Da={kv["a"]}"); + args.Add($"-be"); + return string.Join(" ", args); +} + +var outputItem = new List(); + +foreach (var bb in ByteBuffer) +{ + var kv = new Hashtable(); + kv["type"] = bb.GetMetadata("Type"); + kv["RW"] = bb.GetMetadata("RW"); + kv["BO"] = bb.GetMetadata("BO"); + kv["BIN"] = bb.GetMetadata("Bin"); + + fixRw(kv, (string)kv["RW"]); + typesAndBits(kv, (string)kv["type"], (string)kv["BO"]); + + var args = new List(); + args.Add($"-K{kv["type"]}"); + args.Add($"-K{kv["category"]}"); + args.Add($"-K{kv["streams"]}"); + args.Add($"-Dtype={kv["type"]}"); + args.Add($"-DType={kv["Type"]}"); + args.Add($"-Dfulltype={kv["fulltype"]}"); + args.Add($"-DFulltype={kv["Fulltype"]}"); + args.Add($"-Dstreamtype={kv["streamtype"]}"); + args.Add($"-DStreamtype={kv["Streamtype"]}"); + args.Add($"-Dx={kv["x"]}"); + args.Add($"-Dmemtype={kv["memtype"]}"); + args.Add($"-DMemtype={kv["Memtype"]}"); + args.Add($"-DSwaptype={kv["Swaptype"]}"); + args.Add($"-DfromBits={kv["fromBits"]}"); + args.Add($"-DtoBits={kv["toBits"]}"); + args.Add($"-DLG_BYTES_PER_VALUE={kv["LBPV"]}"); + args.Add($"-DBYTES_PER_VALUE=\"{(1 << int.Parse((string)kv["LBPV"]))}\""); + args.Add($"-DBO={kv["BO"]}"); + args.Add($"-Dswap={kv["swap"]}"); + args.Add($"-DRW={kv["RW"]}"); + args.Add($"-K{kv["rwkey"]}"); + args.Add($"-Da={kv["a"]}"); + args.Add($"-DA={kv["A"]}"); + args.Add($"-Kbo{kv["BO"]}"); + + var t = new TaskItem(bb); + t.SetMetadata("CMD", string.Join(" ", args)); + + if ((string)kv["BIN"] == "1") + { + t.SetMetadata("CMD_char", genBinOps("char", (string)kv["BO"], (string)kv["RW"], "two", "one")); + t.SetMetadata("CMD_short", genBinOps("short", (string)kv["BO"], (string)kv["RW"], "two", "one")); + t.SetMetadata("CMD_int", genBinOps("int", (string)kv["BO"], (string)kv["RW"], "four", "three")); + t.SetMetadata("CMD_long", genBinOps("long", (string)kv["BO"], (string)kv["RW"], "eight", "seven")); + t.SetMetadata("CMD_float", genBinOps("float", (string)kv["BO"], (string)kv["RW"], "four", "three")); + t.SetMetadata("CMD_double", genBinOps("double", (string)kv["BO"], (string)kv["RW"], "eight", "seven")); + } + + outputItem.Add(t); +} + +OutputItem = outputItem.ToArray(); + +]]> + + + + + + + + + + + + + i.Contains("#BIN") == false)); + ]]> + + + + + + + + + + + + + + + <_Src Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_ByteBuffer.Template).java.template" /> + <_Bin Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_ByteBuffer.Template)-bin.java.template" /> + <_Tmp Include="$(GenSrc)java\nio\%(_ByteBuffer.Identity).java.tmp" /> + <_Dst Include="$(GenSrc)java\nio\%(_ByteBuffer.Identity).java" /> + + + + + + + + + + + + + + + + + + + + + + + + + + TransformByteBuffersItems; + GenerateByteBuffers; + $(GenerateSourceDependsOn); + + + $(GenerateDataDependsOn); From 4456462039a938979abf010759a80f85cc750467 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 10:16:45 -0500 Subject: [PATCH 15/41] Try just using 'wsl'. --- src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 2 +- src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs index df450a1d83..34a2c9039c 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -226,7 +226,7 @@ void LogWithLevel(string level, string message) /// Command BuildCommand() { - var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap(Environment.ExpandEnvironmentVariables("%SystemRoot%\\System32\\wsl.exe")).WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); + var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap("wsl").WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables).WithValidation(CommandResultValidation.None); cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); return cmd; diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs index eae3881670..a0a05e1de2 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -63,7 +63,7 @@ public IkvmWslPath(ResourceManager taskResources, string helpKeywordPrefix) : /// protected override async Task ExecuteAsync(CancellationToken cancellationToken) { - var cli = Cli.Wrap(Environment.ExpandEnvironmentVariables("%SystemRoot%\\System32\\wsl.exe")).WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); + var cli = Cli.Wrap("wsl").WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); Log.LogCommandLine(cli.ToString()); var exe = await cli.ExecuteAsync(cancellationToken); return true; From 417a8ad9fe5b309664658fa1d3320cc543cd355c Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 10:16:55 -0500 Subject: [PATCH 16/41] Plural. --- src/IKVM.Java/IKVM.Java.msbuildproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index bfd63be782..61ccc54d12 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -472,7 +472,7 @@ - + @@ -587,7 +587,7 @@ - GenerateCharsetMapping; + GenerateCharsetMappings; GenerateStandardCharsets; $(GenerateSourceDependsOn); From 25bef6f9e9ae0a742846e8e3ddf5039e3ae7a371 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 16:44:17 -0500 Subject: [PATCH 17/41] Fix path? --- src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 2 +- src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 2 +- src/ikvmstub/ikvmstub.csproj | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs index 34a2c9039c..474fab7ae8 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -226,7 +226,7 @@ void LogWithLevel(string level, string message) /// Command BuildCommand() { - var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap("wsl").WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); + var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap(Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\wsl.exe")).WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables).WithValidation(CommandResultValidation.None); cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); return cmd; diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs index a0a05e1de2..910f7c0556 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -63,7 +63,7 @@ public IkvmWslPath(ResourceManager taskResources, string helpKeywordPrefix) : /// protected override async Task ExecuteAsync(CancellationToken cancellationToken) { - var cli = Cli.Wrap("wsl").WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); + var cli = Cli.Wrap(Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\wsl.exe")).WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); Log.LogCommandLine(cli.ToString()); var exe = await cli.ExecuteAsync(cancellationToken); return true; diff --git a/src/ikvmstub/ikvmstub.csproj b/src/ikvmstub/ikvmstub.csproj index 0e8f641af8..35a75bfb77 100644 --- a/src/ikvmstub/ikvmstub.csproj +++ b/src/ikvmstub/ikvmstub.csproj @@ -3,7 +3,6 @@ Exe net472;net6.0 $(_SupportedToolRuntimes) - true From 507b3dfe6e5f8eacb038997b690bf53357a22237 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 16:47:07 -0500 Subject: [PATCH 18/41] Try current working dir. --- src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs index 910f7c0556..bc5395e949 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -1,6 +1,7 @@ namespace IKVM.MSBuild.Tasks { using System; + using System.IO; using System.Resources; using System.Threading; using System.Threading.Tasks; @@ -63,9 +64,17 @@ public IkvmWslPath(ResourceManager taskResources, string helpKeywordPrefix) : /// protected override async Task ExecuteAsync(CancellationToken cancellationToken) { - var cli = Cli.Wrap(Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\wsl.exe")).WithWorkingDirectory(CurrentWorkingDirectory).WithArguments(AddArguments).WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); + var cli = Cli.Wrap(Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\wsl.exe")) + .WithArguments(AddArguments) + .WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); + + // start at recorded working directory in case of relative path + if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory) == true) + cli = cli.WithWorkingDirectory(CurrentWorkingDirectory); + Log.LogCommandLine(cli.ToString()); var exe = await cli.ExecuteAsync(cancellationToken); + return true; } From 7eb33a5154416ffcc225af759e8502fec0db52b6 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 16:58:07 -0500 Subject: [PATCH 19/41] Current current dir. --- src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs index 474fab7ae8..71789fab87 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -2,6 +2,7 @@ { using System; using System.Collections.Generic; + using System.IO; using System.Resources; using System.Runtime.InteropServices; using System.Text; @@ -175,19 +176,19 @@ protected override async Task ExecuteAsync(CancellationToken cancellationT if (stderr.Count >= 2) cli = cli.WithStandardErrorPipe(PipeTarget.Merge(stderr)); - // log the final command line - Log.LogMessage(MessageImportance.High, cli.ToString()); - // log the environment variables being passed if (cli.EnvironmentVariables.Count > 0) { var s = new StringBuilder(); foreach (var env in cli.EnvironmentVariables) - s.AppendLine($"ENV {env.Key}={env.Value}"); + s.AppendLine($"env {env.Key}={env.Value}"); - Log.LogMessage(MessageImportance.High, s.ToString()); + Log.LogMessage(MessageImportance.Low, s.ToString()); } + // log the final command line + Log.LogMessage(MessageImportance.Normal, cli.ToString()); + // execute executable var exe = await cli.ExecuteAsync(cancellationToken); if (exe.ExitCode != 0) @@ -227,8 +228,13 @@ void LogWithLevel(string level, string message) Command BuildCommand() { var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap(Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\wsl.exe")).WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); - cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables).WithValidation(CommandResultValidation.None); - cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); + cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables); + cmd = cmd.WithValidation(CommandResultValidation.None); + + // set working directory, if available + if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory)) + cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); + return cmd; } From d2529115495520c2aad716674ab23f8887102c27 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 18:35:10 -0500 Subject: [PATCH 20/41] Add generation of calendar data. --- openjdk.props | 3 --- src/IKVM.Java/IKVM.Java.msbuildproj | 30 ++++++++++++++++++++++++++--- src/ikvmc/ikvmc.csproj | 1 - 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/openjdk.props b/openjdk.props index e60fd61492..81d83cbead 100644 --- a/openjdk.props +++ b/openjdk.props @@ -17,13 +17,10 @@ - - - diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 61ccc54d12..ce5754a937 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -1046,9 +1046,31 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - - $(GenerateDataDependsOn); - + 21.0.1 + $(OpenJdkDir)jdk\src\share\classes\sun\util\cldr\resources\$(CalendarDataVersion.Replace('.', '_')) + + + + + + + + + + + + + + + + + + + + + GenerateCalendarData; + $(GenerateSourceDependsOn); + @@ -1060,6 +1082,8 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN + <_GenSrcJavaResource Include="$(GenSrc)**\*" Exclude="$(GenSrc)jdk\gensrc\**\*.java;$(GenSrc)jdk\gensrc\**\*.class" /> + diff --git a/src/ikvmc/ikvmc.csproj b/src/ikvmc/ikvmc.csproj index 8ff57289d0..549ed8f260 100644 --- a/src/ikvmc/ikvmc.csproj +++ b/src/ikvmc/ikvmc.csproj @@ -3,7 +3,6 @@ Exe net472;net6.0 $(_SupportedToolRuntimes) - true From 303d805a25cf585c1c7ab360ede486fd2adbf243 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 18:47:13 -0500 Subject: [PATCH 21/41] Ignore working directory for a bit. Might fix CI? --- src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs index bc5395e949..4ce47e3e9e 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -69,8 +69,8 @@ protected override async Task ExecuteAsync(CancellationToken cancellationT .WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); // start at recorded working directory in case of relative path - if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory) == true) - cli = cli.WithWorkingDirectory(CurrentWorkingDirectory); + //if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory) == true) + // cli = cli.WithWorkingDirectory(CurrentWorkingDirectory); Log.LogCommandLine(cli.ToString()); var exe = await cli.ExecuteAsync(cancellationToken); From bf53cc4fc414686eff4e72cbeeb76079bb8be4f1 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 19:46:56 -0500 Subject: [PATCH 22/41] check wsl.exe --- .github/workflows/IKVM.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index 8e3c6bf25b..f1c4971077 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -213,6 +213,7 @@ jobs: - name: NuGet Restore run: dotnet restore IKVM.sln working-directory: ${{ env.WORKPATH }}/ikvm + - run: dir C:\Windows\System32\wsl.exe - name: Build Artifacts run: | msbuild /m /bl ` From a736ce0bd5bc954ef60521ca8ff7a57360e489ba Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 20:46:45 -0500 Subject: [PATCH 23/41] Try to change to 64bit version of msbuild. --- .github/workflows/IKVM.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index f1c4971077..6f7261c1ce 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -182,6 +182,8 @@ jobs: restore-keys: ${{ runner.os }}-nuget-2- - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1 + with: + msbuild-architecture: x64 - name: Download OpenJDK 8 Build uses: actions/download-artifact@v3 with: From 0dbf73868b01bbba5e560ff5b6de2333b859f758 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 25 Oct 2023 21:48:28 -0500 Subject: [PATCH 24/41] use sysnative for 32 bit. Remove --, seems unsupported on some WSL versions. --- src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 12 ++++++++++-- src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 20 +++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs index 71789fab87..0bdddb2ffe 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -227,7 +227,7 @@ void LogWithLevel(string level, string message) /// Command BuildCommand() { - var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap(Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\wsl.exe")).WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); + var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap(GetWslExePath()).WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables); cmd = cmd.WithValidation(CommandResultValidation.None); @@ -238,6 +238,15 @@ Command BuildCommand() return cmd; } + /// + /// Gets the path to wsl.exe based on the current environment. + /// + /// + string GetWslExePath() + { + return Environment.ExpandEnvironmentVariables(RuntimeInformation.ProcessArchitecture == Architecture.X86 ? @"%SystemRoot%\Sysnative\wsl.exe" : @"%SystemRoot%\System32\wsl.exe"); + } + /// /// Builds the arguments to execute. /// @@ -247,7 +256,6 @@ void BuildWslArguments(ArgumentsBuilder builder) if (WslDistribution != null) builder.Add("-d").Add(WslDistribution); - builder.Add("--"); builder.Add(Command); BuildArguments(builder); } diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs index 4ce47e3e9e..7087c7b6ad 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -3,6 +3,7 @@ using System; using System.IO; using System.Resources; + using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; @@ -64,20 +65,29 @@ public IkvmWslPath(ResourceManager taskResources, string helpKeywordPrefix) : /// protected override async Task ExecuteAsync(CancellationToken cancellationToken) { - var cli = Cli.Wrap(Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\wsl.exe")) + var cmd = Cli.Wrap(GetWslExePath()) .WithArguments(AddArguments) .WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); // start at recorded working directory in case of relative path - //if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory) == true) - // cli = cli.WithWorkingDirectory(CurrentWorkingDirectory); + if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory) == true) + cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); - Log.LogCommandLine(cli.ToString()); - var exe = await cli.ExecuteAsync(cancellationToken); + Log.LogCommandLine(cmd.ToString()); + var exe = await cmd.ExecuteAsync(cancellationToken); return true; } + /// + /// Gets the path to wsl.exe based on the current environment. + /// + /// + string GetWslExePath() + { + return Environment.ExpandEnvironmentVariables(RuntimeInformation.ProcessArchitecture == Architecture.X86 ? @"%SystemRoot%\Sysnative\wsl.exe" : @"%SystemRoot%\System32\wsl.exe"); + } + /// /// Attempts to set the path. /// From 69bd618039eef659edef98e5e207f8410c37bed8 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Thu, 26 Oct 2023 01:33:15 -0500 Subject: [PATCH 25/41] No --. Remove check. --- .github/workflows/IKVM.yml | 1 - src/IKVM.Java/IKVM.Java.msbuildproj | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index 6f7261c1ce..04b9c17ce6 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -215,7 +215,6 @@ jobs: - name: NuGet Restore run: dotnet restore IKVM.sln working-directory: ${{ env.WORKPATH }}/ikvm - - run: dir C:\Windows\System32\wsl.exe - name: Build Artifacts run: | msbuild /m /bl ` diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index ce5754a937..7527ccabcc 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -539,7 +539,7 @@ - + From 8063acecdb76158172f3b7ee32bea27b2c96aba7 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Thu, 26 Oct 2023 09:36:52 -0500 Subject: [PATCH 26/41] echo out command --- src/IKVM.Java/IKVM.Java.msbuildproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 7527ccabcc..2644446f23 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -539,7 +539,7 @@ - + From 41658c280882a45f26b670ebee5073c84b455c1f Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Thu, 26 Oct 2023 14:12:42 -0500 Subject: [PATCH 27/41] Fix custom distro launching. Add -e to wsl command line. Have hasher launcher copy stdin to temp file, because WSL1 can't seem to provide a valid file handle to Java. --- src/IKVM.Java/IKVM.Java.msbuildproj | 62 +++++++++++++++----------- src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 7 +-- src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 7 +-- 3 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 2644446f23..007edf3ed7 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -514,52 +514,48 @@ <_BuildToolsOutputPath>$([System.IO.Path]::GetFullPath('$(BuildToolsOutputPath)')) - + - + - + - + - + - + - - + + - + - - + + - + - + - - - - <_GenerateStandardCharsetsEnv Include="CLASSPATH" Value="$(_BuildToolsOutputPath)" /> <_GenerateStandardCharsetsEnv Include="NAWK" Value="nawk" /> @@ -575,7 +571,7 @@ <_GenerateStandardCharsetsArg Include="$(_DestinationDir)" /> - + @@ -629,19 +625,19 @@ <_DestinationDir>$(GenSrc)java\nio\%(GenerateExceptionsItem.Identity) - + - + - + - + @@ -658,7 +654,7 @@ - + @@ -1056,12 +1052,12 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - + - + @@ -1140,4 +1136,20 @@ $([MSBuild]::Unescape('$(___IkvmUnixExecCs)')) + + + + + + + + + + + + + + diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs index 0bdddb2ffe..7edc257eba 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs @@ -40,7 +40,7 @@ public class IkvmUnixExec : IkvmAsyncTask /// /// Optionally the distribution to use. /// - public string WslDistribution { get; set; } + public string WslDistributionName { get; set; } /// /// Path to the working directory. @@ -253,9 +253,10 @@ string GetWslExePath() /// void BuildWslArguments(ArgumentsBuilder builder) { - if (WslDistribution != null) - builder.Add("-d").Add(WslDistribution); + if (string.IsNullOrEmpty(WslDistributionName) == false) + builder.Add("-d").Add(WslDistributionName); + builder.Add("-e"); builder.Add(Command); BuildArguments(builder); } diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs index 7087c7b6ad..aa078d756d 100644 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs @@ -28,7 +28,7 @@ public class IkvmWslPath : IkvmAsyncTask /// /// Optional name of the distro to use. /// - public string Distribution { get; set; } + public string DistributionName { get; set; } /// /// Initializes a new instance. @@ -104,9 +104,10 @@ void TrySetPath(string arg) /// void AddArguments(ArgumentsBuilder builder) { - if (Distribution != null) - builder.Add("-d").Add(Distribution); + if (string.IsNullOrEmpty(DistributionName) == false) + builder.Add("-d").Add(DistributionName); + builder.Add("-e"); builder.Add("wslpath"); builder.Add(Path.Replace("\\", "\\\\"), true); } From 27fb968574b375b2df0eb638e387583630eb5c97 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Thu, 26 Oct 2023 16:34:53 -0500 Subject: [PATCH 28/41] comments describing commands. --- openjdk.props | 4 +++- src/IKVM.Java/IKVM.Java.msbuildproj | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/openjdk.props b/openjdk.props index 81d83cbead..d00a90a01e 100644 --- a/openjdk.props +++ b/openjdk.props @@ -20,7 +20,9 @@ - + + + diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 007edf3ed7..071bf7e794 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -539,11 +539,21 @@ - + + - + + From d446b05b14609d29a8cd563c430dc75bd1b93726 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Thu, 26 Oct 2023 18:09:05 -0500 Subject: [PATCH 29/41] fix escape --- src/IKVM.Java/IKVM.Java.msbuildproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index 071bf7e794..fa5fe49cae 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -546,7 +546,7 @@ cat $t rm $t --> - + From 5b018b7e23babc3cd28077419f9b3d4ad1a3f6a2 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Mon, 30 Oct 2023 15:48:06 -0500 Subject: [PATCH 30/41] GenerateStandardCharsets using C# instead of shell scripts. --- IKVM.sln | 47 +-- src/IKVM.Image/IKVM.Image.csproj | 4 + src/IKVM.Java/IKVM.Java.msbuildproj | 616 ++++++++++++++++++---------- 3 files changed, 412 insertions(+), 255 deletions(-) diff --git a/IKVM.sln b/IKVM.sln index ea5ffb12bf..c13f850cb3 100644 --- a/IKVM.sln +++ b/IKVM.sln @@ -53,19 +53,10 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.MSBuild.Tasks.Tests", "src\IKVM.MSBuild.Tasks.Tests\IKVM.MSBuild.Tasks.Tests.csproj", "{E7C0E8FA-F34C-48C6-AD55-FD9798F5BC71}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Java", "src\IKVM.Java\IKVM.Java.msbuildproj", "{ABD81C7E-F986-4018-986E-ACAF82C64D3A}" - ProjectSection(ProjectDependencies) = postProject - {0A87FF49-AC9D-479A-ACBB-F4028A0BE1F7} = {0A87FF49-AC9D-479A-ACBB-F4028A0BE1F7} - {17979A73-C0CE-41CD-B54F-4E72B998E6D0} = {17979A73-C0CE-41CD-B54F-4E72B998E6D0} - {2F29E48C-63C3-4E47-BCBA-A7454B9119CF} = {2F29E48C-63C3-4E47-BCBA-A7454B9119CF} - {50954AE0-E513-4CE7-AC8E-F3896CA0BEB7} = {50954AE0-E513-4CE7-AC8E-F3896CA0BEB7} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.NET.Sdk", "src\IKVM.NET.Sdk\IKVM.NET.Sdk.msbuildproj", "{704BD7C7-7746-4D72-A86E-ECFE7BBD80CC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.MSBuild", "src\IKVM.MSBuild\IKVM.MSBuild.msbuildproj", "{AE5BFBC6-7DD4-4ACA-BEA7-86F842F38B64}" - ProjectSection(ProjectDependencies) = postProject - {B60EC8AA-3CDF-45E4-9ACD-3246B375C027} = {B60EC8AA-3CDF-45E4-9ACD-3246B375C027} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM", "src\IKVM\IKVM.csproj", "{95F23908-2D65-40C7-9EF1-B5C8543503AA}" EndProject @@ -116,55 +107,25 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wsimport", "src\wsimport\wsimport.msbuildproj", "{004561E2-DED0-464D-A7B9-85D98281FED4}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.linux-x64", "src\IKVM.Image.JRE.runtime.linux-x64\IKVM.Image.JRE.runtime.linux-x64.csproj", "{8068292D-8B2E-417B-B7CE-0E7159881C50}" - ProjectSection(ProjectDependencies) = postProject - {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.win-x64", "src\IKVM.Image.JRE.runtime.win-x64\IKVM.Image.JRE.runtime.win-x64.csproj", "{27D0142E-7643-4E64-A6B2-995E76EF00A2}" - ProjectSection(ProjectDependencies) = postProject - {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.linux-x64", "src\IKVM.Image.JDK.runtime.linux-x64\IKVM.Image.JDK.runtime.linux-x64.csproj", "{BE31AC7C-79CC-4180-A5E8-BEB3FD7579DC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.win-x64", "src\IKVM.Image.JDK.runtime.win-x64\IKVM.Image.JDK.runtime.win-x64.csproj", "{71444CB1-778F-4DD5-9BDF-ACB310C97345}" - ProjectSection(ProjectDependencies) = postProject - {CCE3DE31-5DE7-4157-90D1-BAFA08C181EC} = {CCE3DE31-5DE7-4157-90D1-BAFA08C181EC} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image", "src\IKVM.Image\IKVM.Image.csproj", "{95C8865C-AB87-4998-880E-38B7F76BAC57}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.win-x86", "src\IKVM.Image.JRE.runtime.win-x86\IKVM.Image.JRE.runtime.win-x86.csproj", "{CBB5E3B3-2B0F-41F3-8110-FDD9614FCE5D}" - ProjectSection(ProjectDependencies) = postProject - {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.win-x86", "src\IKVM.Image.JDK.runtime.win-x86\IKVM.Image.JDK.runtime.win-x86.csproj", "{3E91FECF-80C0-463C-AD62-40062E0D313F}" - ProjectSection(ProjectDependencies) = postProject - {CCE3DE31-5DE7-4157-90D1-BAFA08C181EC} = {CCE3DE31-5DE7-4157-90D1-BAFA08C181EC} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK-bin", "src\IKVM.Image.JDK-bin\IKVM.Image.JDK-bin.csproj", "{CCE3DE31-5DE7-4157-90D1-BAFA08C181EC}" ProjectSection(ProjectDependencies) = postProject - {004561E2-DED0-464D-A7B9-85D98281FED4} = {004561E2-DED0-464D-A7B9-85D98281FED4} - {03F00630-3625-440D-BE43-51751FCE7806} = {03F00630-3625-440D-BE43-51751FCE7806} - {1685EDBF-1A43-46C1-BC3B-378C909CA3DF} = {1685EDBF-1A43-46C1-BC3B-378C909CA3DF} - {2B536749-A2CD-4873-803A-5553D25E88EC} = {2B536749-A2CD-4873-803A-5553D25E88EC} - {4371190E-AD8B-4625-A520-B745B05DE005} = {4371190E-AD8B-4625-A520-B745B05DE005} - {78BE5834-EC02-48C5-A83A-2693D777375A} = {78BE5834-EC02-48C5-A83A-2693D777375A} - {7BC3FC79-5938-4CD7-9528-47D5DC18729E} = {7BC3FC79-5938-4CD7-9528-47D5DC18729E} - {B240F8BA-6C35-4C19-9035-2821CC6BFEA8} = {B240F8BA-6C35-4C19-9035-2821CC6BFEA8} - {C6C34134-D80C-43CC-A477-32B4172374D2} = {C6C34134-D80C-43CC-A477-32B4172374D2} - {ECF6B110-DF3B-4D29-91C8-45AD4C7D4B17} = {ECF6B110-DF3B-4D29-91C8-45AD4C7D4B17} - {FB1F02F2-3A18-49CC-A288-EC0834D90EED} = {FB1F02F2-3A18-49CC-A288-EC0834D90EED} + {B60EC8AA-3CDF-45E4-9ACD-3246B375C027} = {B60EC8AA-3CDF-45E4-9ACD-3246B375C027} EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE-bin", "src\IKVM.Image.JRE-bin\IKVM.Image.JRE-bin.csproj", "{162A1F6D-7752-4686-A6C2-923633F4E4C0}" - ProjectSection(ProjectDependencies) = postProject - {4F7D51D0-F52D-46EF-94DF-C4081587FBB4} = {4F7D51D0-F52D-46EF-94DF-C4081587FBB4} - {7C7BCE2E-88CE-4EA8-863E-37F6B8A824C4} = {7C7BCE2E-88CE-4EA8-863E-37F6B8A824C4} - {B2EF307F-90AA-4CFE-B7F3-FF741545E35B} = {B2EF307F-90AA-4CFE-B7F3-FF741545E35B} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "javac-ref", "src\javac-ref\javac-ref.msbuildproj", "{5DC963FD-6742-47BB-BC96-365B82F73C88}" EndProject @@ -199,9 +160,6 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.linux-arm64", "src\IKVM.Image.JDK.runtime.linux-arm64\IKVM.Image.JDK.runtime.linux-arm64.csproj", "{DF09A175-C790-434D-9810-A6BBB3EEC548}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.linux-arm64", "src\IKVM.Image.JRE.runtime.linux-arm64\IKVM.Image.JRE.runtime.linux-arm64.csproj", "{2D787827-44DA-406C-8DAC-34CE61D658B0}" - ProjectSection(ProjectDependencies) = postProject - {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.MSBuild.Tools.runtime.linux-arm64", "src\IKVM.MSBuild.Tools.runtime.linux-arm64\IKVM.MSBuild.Tools.runtime.linux-arm64.csproj", "{5D5A51AC-95FE-42DE-BEBE-560109003C1D}" EndProject @@ -210,9 +168,6 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.linux-arm", "src\IKVM.Image.JDK.runtime.linux-arm\IKVM.Image.JDK.runtime.linux-arm.csproj", "{437506E7-B124-4808-8AE7-8864AC9EA36A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.linux-arm", "src\IKVM.Image.JRE.runtime.linux-arm\IKVM.Image.JRE.runtime.linux-arm.csproj", "{833EAB0B-F2EE-47B5-8A54-EDE4DC655122}" - ProjectSection(ProjectDependencies) = postProject - {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "native2ascii", "src\native2ascii\native2ascii.msbuildproj", "{7BC3FC79-5938-4CD7-9528-47D5DC18729E}" EndProject diff --git a/src/IKVM.Image/IKVM.Image.csproj b/src/IKVM.Image/IKVM.Image.csproj index 51c5e47ff3..d6ba86ebd1 100644 --- a/src/IKVM.Image/IKVM.Image.csproj +++ b/src/IKVM.Image/IKVM.Image.csproj @@ -47,4 +47,8 @@ + + + + diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index fa5fe49cae..b5c950fc6e 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -382,8 +382,9 @@ <_GenerateCharsetDecoderArgs Include="-Dcoding="decoding"" /> <_GenerateCharsetDecoderArgs Include="-DOtherCoder="Encoder"" /> <_GenerateCharsetDecoderArgs Include="-DreplTypeName="string"" /> - <_GenerateCharsetDecoderArgs Include="-DdefaultRepl="\"\\uFFFD\""" /> - <_GenerateCharsetDecoderArgs Include="-DdefaultReplName="<tt>\"\\uFFFD\"</tt>"" /> + <_GenerateCharsetDecoderArgs Include="-DdefaultRepl="\"%5c%5cuFFFD\""" /> + <_GenerateCharsetDecoderArgs Condition="$([MSBuild]::IsOsPlatform('Windows'))" Include="-DdefaultReplName="<tt>""&#92%3buFFFD""</tt>"" /> + <_GenerateCharsetDecoderArgs Condition="!$([MSBuild]::IsOsPlatform('Windows'))" Include="-DdefaultReplName='<tt>"\&#92%3buFFFD"<\/tt>'" /> <_GenerateCharsetDecoderArgs Include="-DreplType="String"" /> <_GenerateCharsetDecoderArgs Include="-DreplFQType="java.lang.String"" /> <_GenerateCharsetDecoderArgs Include="-DreplLength="length()"" /> @@ -494,100 +495,266 @@ + + + + + - - - - - - - - - <_Script>$(BuildScriptsDir)genCharsetProvider.sh - <_TempDir>$(IntermediateOutputPath)GenerateStandardCharsets.dir - <_JavaExe>$(JavaPath) - <_ScriptDir>$(BuildScriptsDir) - <_StandardCharsetsFile>$(OpenJdkDir)jdk\src\share\classes\sun\nio\cs\standard-charsets - <_DestinationDir>$(GenSrc)sun\nio\cs\ - <_Hasher>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)GenerateStandardCharsets.hasher.sh')) - <_BuildToolsOutputPath>$([System.IO.Path]::GetFullPath('$(BuildToolsOutputPath)')) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + class Charset + { + + public string Name { get; set; } + + public string ClassName { get; set; } + + public List Aliases { get; set; } = new (); + + } + + static readonly Regex copyrightRegex = new Regex(@"copyright\s+(?\S+)*", RegexOptions.Compiled); + static readonly Regex packageRegex = new Regex(@"package\s+(?\S+)", RegexOptions.Compiled); + static readonly Regex classRegex = new Regex(@"class\s+(?\S+)", RegexOptions.Compiled); + static readonly Regex charsetRegex = new Regex(@"charset\s+(?\S+)\s+(?\S+)", RegexOptions.Compiled); + static readonly Regex aliasRegex = new Regex(@"\s+alias\s+(?\S+)", RegexOptions.Compiled); + + [Required] + public string SourceFile { get; set; } + + [Output] + public string Copyright { get; set; } + + [Output] + public string Package { get; set; } + + [Output] + public string Class { get; set; } + + [Required] + public string ClassesFile { get; set; } + + [Required] + public string AliasesFile { get; set; } + + [Output] + public ITaskItem[] Charsets { get; set; } + + public override bool Execute() + { + string copyright = null; + string package = null; + string clazz = null; + List charsets = new (); + Charset currentCharset = null; + + string line; + using var file = File.OpenText(SourceFile); + while ((line = file.ReadLine()) != null) + { + if (string.IsNullOrWhiteSpace(line)) + continue; + + var p = line.IndexOf("#"); + if (p >= 0) + line = line.Substring(0, p); + if (string.IsNullOrWhiteSpace(line)) + continue; + + if (copyrightRegex.Match(line) is Match copyrightMatch && copyrightMatch.Success) + { + currentCharset = null; + copyright = copyrightMatch.Groups["copyright"].Value; + continue; + } + + if (packageRegex.Match(line) is Match packageMatch && packageMatch.Success) + { + currentCharset = null; + package = packageMatch.Groups["package"].Value; + continue; + } + + if (classRegex.Match(line) is Match classMatch && classMatch.Success) + { + currentCharset = null; + clazz = classMatch.Groups["class"].Value; + continue; + } + + if (charsetRegex.Match(line) is Match charsetMatch && charsetMatch.Success) + { + charsets.Add(currentCharset = new Charset()); + currentCharset.Name = charsetMatch.Groups["name"].Value; + currentCharset.ClassName = charsetMatch.Groups["classname"].Value; + continue; + } + + if (currentCharset != null && aliasRegex.Match(line) is Match aliasMatch && aliasMatch.Success) + { + if (currentCharset == null) + continue; + + currentCharset.Aliases.Add(aliasMatch.Groups["alias"].Value); + continue; + } + } + + Copyright = copyright; + Package = package; + Class = clazz; + var l = new List(); + foreach (var charset in charsets) + { + var t = new TaskItem(charset.Name); + t.SetMetadata("ClassName", charset.ClassName); + t.SetMetadata("Aliases", string.Join(";", charset.Aliases)); + l.Add(t); + } + Charsets = l.ToArray(); + + using var classesFile = new StreamWriter(File.Open(ClassesFile, FileMode.Create)); + foreach (var charset in charsets) + classesFile.WriteLine("{0} \"{1}\"", charset.Name.ToLower().PadRight(20), charset.ClassName); + + using var aliasesFile = new StreamWriter(File.Open(AliasesFile, FileMode.Create)); + foreach (var charset in charsets) + foreach (var alias in charset.Aliases) + aliasesFile.WriteLine("{0} \"{1}\"", alias.ToLower().PadRight(20), charset.Name.ToLower()); + + return true; + } + +} + ]]> + + + - - <_GenerateStandardCharsetsEnv Include="CLASSPATH" Value="$(_BuildToolsOutputPath)" /> - <_GenerateStandardCharsetsEnv Include="NAWK" Value="nawk" /> - <_GenerateStandardCharsetsEnv Include="TEMPDIR" Value="$(_TempDir)" /> - <_GenerateStandardCharsetsEnv Include="HASHER" Value="sh -e $(_Hasher)" /> - <_GenerateStandardCharsetsEnv Include="SCRIPTS" Value="$(_ScriptDir)" /> - + + + + - <_GenerateStandardCharsetsArg Include="-e" /> - <_GenerateStandardCharsetsArg Include="$(_Script)" /> - <_GenerateStandardCharsetsArg Include="$(_StandardCharsetsFile)" /> - <_GenerateStandardCharsetsArg Include="$(_DestinationDir)" /> - +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +public class WriteStandardCharsets : Task +{ - + [Required] + public string OutputFile { get; set; } + + [Output] + public string Copyright { get; set; } + + [Output] + public string Package { get; set; } + + [Output] + public string Class { get; set; } + + [Output] + public ITaskItem[] Charsets { get; set; } + + [Required] + public string AliasesClassFile { get; set; } + + [Required] + public string ClassesClassFile { get; set; } + + [Required] + public string CacheClassFile { get; set; } + + public override bool Execute() + { + using var o = new StreamWriter(File.Open(OutputFile, FileMode.Create)); + o.WriteLine($@"package {Package};"); + o.WriteLine($@""); + o.WriteLine($@"import java.nio.charset.*;"); + o.WriteLine($@""); + o.WriteLine($@""); + o.WriteLine($@"public class {Class}"); + o.WriteLine($@" extends FastCharsetProvider"); + o.WriteLine($@"{{"); + o.WriteLine($@""); + + foreach (var charset in Charsets) + { + o.WriteLine($@" static final String[] aliases_{charset.GetMetadata("ClassName")} = new String[] {{"); + foreach (var alias in charset.GetMetadata("Aliases").Split(';')) + o.WriteLine($@" ""{alias}"","); + o.WriteLine($@" }};"); + o.WriteLine($@""); + } + + o.Write(File.ReadAllText(AliasesClassFile)); + o.Write(File.ReadAllText(ClassesClassFile)); + o.Write(File.ReadAllText(CacheClassFile)); + + o.WriteLine($@" public StandardCharsets() {{"); + o.WriteLine($@" super(""sun.nio.cs"", new Aliases(), new Classes(), new Cache());"); + o.WriteLine($@" }}"); + o.WriteLine($@""); + + o.WriteLine($@"}}"); + o.WriteLine($@""); + + return true; + } + +} + ]]> + + + - + + + + + + + + + + + + + + + + + - - + + + + + + @@ -609,8 +776,8 @@ - - + + @@ -621,18 +788,28 @@ + + - - - + + + - + <_Script>$(BuildScriptsDir)genExceptions.sh <_Scripts>$(BuildScriptsDir) - <_Exceptions>$(OpenJdkDir)jdk\src\share\classes\java\nio\%(GenerateExceptionsItem.Identity)\exceptions - <_DestinationDir>$(GenSrc)java\nio\%(GenerateExceptionsItem.Identity) + <_Exceptions>$(OpenJdkDir)jdk\src\share\classes\java\nio\%(GenerateExceptions.Identity)\exceptions + <_DestinationDir>$(GenSrc)java\nio\%(GenerateExceptions.Identity) @@ -663,12 +840,13 @@ <_GenerateExceptionsArg Include="$(_DestinationDir)" /> - + - + + @@ -679,100 +857,114 @@ + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - + + - - + + - - + + (); +var genBufferCommand = new List(); -foreach (var bb in ByteBuffer) +foreach (var bb in GenBuffer) { var kv = new Hashtable(); kv["type"] = bb.GetMetadata("Type"); @@ -981,23 +1173,29 @@ foreach (var bb in ByteBuffer) t.SetMetadata("CMD_double", genBinOps("double", (string)kv["BO"], (string)kv["RW"], "eight", "seven")); } - outputItem.Add(t); + genBufferCommand.Add(t); } -OutputItem = outputItem.ToArray(); +GenBufferCommand = genBufferCommand.ToArray(); ]]> - + + + - - + + i.Contains("#BIN") == false)); @@ -1006,37 +1204,37 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - - - - + + + + - - + + - <_Src Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_ByteBuffer.Template).java.template" /> - <_Bin Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_ByteBuffer.Template)-bin.java.template" /> - <_Tmp Include="$(GenSrc)java\nio\%(_ByteBuffer.Identity).java.tmp" /> - <_Dst Include="$(GenSrc)java\nio\%(_ByteBuffer.Identity).java" /> + <_Src Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_GenBufferCommand.Template).java.template" /> + <_Bin Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_GenBufferCommand.Template)-bin.java.template" /> + <_Tmp Include="$(GenSrc)java\nio\%(_GenBufferCommand.Identity).java.tmp" /> + <_Dst Include="$(GenSrc)java\nio\%(_GenBufferCommand.Identity).java" /> - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -1045,8 +1243,8 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - TransformByteBuffersItems; - GenerateByteBuffers; + GenerateBuffersSetup; + GenerateBuffers; $(GenerateSourceDependsOn); @@ -1152,8 +1350,8 @@ $([MSBuild]::Unescape('$(___IkvmUnixExecCs)')) - - + + Date: Mon, 30 Oct 2023 15:59:05 -0500 Subject: [PATCH 31/41] Disable draft. --- .github/workflows/IKVM.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index 04b9c17ce6..c7103a3d58 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -746,7 +746,6 @@ jobs: tag: ${{ github.ref_name }} allowUpdates: true artifacts: dist/nuget/*.nupkg,dist/bin/*.zip,dist/bin/*.tar.gz,dist/image/*.zip,dist/image/*.tar.gz,dist/tools/*.zip,dist/tools/*.tar.gz,dist/doc.zip - draft: false token: ${{ secrets.GITHUB_TOKEN }} - name: Push NuGet (GitHub) if: github.event_name != 'pull_request' From 88eed98555f7c62ca83272d65fd9c61237190e42 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Tue, 31 Oct 2023 10:21:34 -0500 Subject: [PATCH 32/41] We're going to simply import the generated Exceptions into our tree for now. They can be regenerated by hand. And this isn't terrible. But it's not ideal. Better than dealing with WSL. --- src/IKVM.Java/IKVM.Java.msbuildproj | 94 +----- .../java/nio/BufferOverflowException.java | 51 +++ .../java/nio/BufferUnderflowException.java | 51 +++ .../local/java/nio/InvalidMarkException.java | 51 +++ .../java/nio/ReadOnlyBufferException.java | 51 +++ .../nio/channels/AcceptPendingException.java | 51 +++ .../nio/channels/AlreadyBoundException.java | 51 +++ .../channels/AlreadyConnectedException.java | 51 +++ .../channels/AsynchronousCloseException.java | 52 +++ .../nio/channels/CancelledKeyException.java | 51 +++ .../channels/ClosedByInterruptException.java | 53 +++ .../nio/channels/ClosedChannelException.java | 54 ++++ .../nio/channels/ClosedSelectorException.java | 51 +++ .../channels/ConnectionPendingException.java | 52 +++ .../FileLockInterruptionException.java | 52 +++ .../IllegalBlockingModeException.java | 51 +++ .../IllegalChannelGroupException.java | 51 +++ .../channels/IllegalSelectorException.java | 52 +++ .../InterruptedByTimeoutException.java | 51 +++ .../NoConnectionPendingException.java | 52 +++ .../channels/NonReadableChannelException.java | 51 +++ .../channels/NonWritableChannelException.java | 51 +++ .../nio/channels/NotYetBoundException.java | 51 +++ .../channels/NotYetConnectedException.java | 51 +++ .../OverlappingFileLockException.java | 53 +++ .../nio/channels/ReadPendingException.java | 51 +++ .../ShutdownChannelGroupException.java | 52 +++ .../channels/UnresolvedAddressException.java | 51 +++ .../UnsupportedAddressTypeException.java | 51 +++ .../nio/channels/WritePendingException.java | 51 +++ .../nio/charset/CharacterCodingException.java | 51 +++ .../charset/IllegalCharsetNameException.java | 68 ++++ .../charset/UnsupportedCharsetException.java | 68 ++++ src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs | 303 ------------------ src/IKVM.MSBuild.Tasks/IkvmWslPath.cs | 117 ------- 35 files changed, 1685 insertions(+), 508 deletions(-) create mode 100644 src/IKVM.Java/local/java/nio/BufferOverflowException.java create mode 100644 src/IKVM.Java/local/java/nio/BufferUnderflowException.java create mode 100644 src/IKVM.Java/local/java/nio/InvalidMarkException.java create mode 100644 src/IKVM.Java/local/java/nio/ReadOnlyBufferException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/AcceptPendingException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/AlreadyBoundException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/AlreadyConnectedException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/AsynchronousCloseException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/CancelledKeyException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/ClosedByInterruptException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/ClosedChannelException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/ClosedSelectorException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/ConnectionPendingException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/FileLockInterruptionException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/IllegalBlockingModeException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/IllegalChannelGroupException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/IllegalSelectorException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/InterruptedByTimeoutException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/NoConnectionPendingException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/NonReadableChannelException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/NonWritableChannelException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/NotYetBoundException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/NotYetConnectedException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/OverlappingFileLockException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/ReadPendingException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/ShutdownChannelGroupException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/UnresolvedAddressException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/UnsupportedAddressTypeException.java create mode 100644 src/IKVM.Java/local/java/nio/channels/WritePendingException.java create mode 100644 src/IKVM.Java/local/java/nio/charset/CharacterCodingException.java create mode 100644 src/IKVM.Java/local/java/nio/charset/IllegalCharsetNameException.java create mode 100644 src/IKVM.Java/local/java/nio/charset/UnsupportedCharsetException.java delete mode 100644 src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs delete mode 100644 src/IKVM.MSBuild.Tasks/IkvmWslPath.cs diff --git a/src/IKVM.Java/IKVM.Java.msbuildproj b/src/IKVM.Java/IKVM.Java.msbuildproj index b5c950fc6e..eed9eb8320 100644 --- a/src/IKVM.Java/IKVM.Java.msbuildproj +++ b/src/IKVM.Java/IKVM.Java.msbuildproj @@ -17,10 +17,6 @@ - - - - @@ -735,15 +731,7 @@ public class WriteStandardCharsets : Task - + @@ -805,49 +793,7 @@ public class WriteStandardCharsets : Task - - <_Script>$(BuildScriptsDir)genExceptions.sh - <_Scripts>$(BuildScriptsDir) - <_Exceptions>$(OpenJdkDir)jdk\src\share\classes\java\nio\%(GenerateExceptions.Identity)\exceptions - <_DestinationDir>$(GenSrc)java\nio\%(GenerateExceptions.Identity) - - - - - - - - - - - - - - - - - - - - <_GenerateExceptionsEnv Include="SCRIPTS" Value="$(_Scripts)" /> - <_GenerateExceptionsEnv Include="NAWK" Value="nawk" /> - - - - <_GenerateExceptionsArg Include="-e" /> - <_GenerateExceptionsArg Include="$(_Script)" /> - <_GenerateExceptionsArg Include="$(_Exceptions)" /> - <_GenerateExceptionsArg Include="$(_DestinationDir)" /> - - - - - - - - - - + @@ -1260,6 +1206,10 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN + + + + @@ -1312,38 +1262,6 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - - <___IkvmAsyncTaskCs>$([System.IO.File]::ReadAllText('$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', '..', 'IKVM.MSBuild.Tasks', 'IkvmAsyncTask.cs'))')) - <___IkvmWslPathCs>$([System.IO.File]::ReadAllText('$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', '..', 'IKVM.MSBuild.Tasks', 'IkvmWslPath.cs'))')) - <___IkvmUnixExecCs>$([System.IO.File]::ReadAllText('$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', '..', 'IKVM.MSBuild.Tasks', 'IkvmUnixExec.cs'))')) - <___CliWrapDll Condition=" '$(MSBuildRuntimeType)' == 'Core' And '$(PkgCliWrap)' != '' ">$(PkgCliWrap)\lib\netcoreapp3.0\CliWrap.dll - <___CliWrapDll Condition=" '$(MSBuildRuntimeType)' != 'Core' And '$(PkgCliWrap)' != '' ">$(PkgCliWrap)\lib\net461\CliWrap.dll - - - - - - - - - - - - - - - - - - - - diff --git a/src/IKVM.Java/local/java/nio/BufferOverflowException.java b/src/IKVM.Java/local/java/nio/BufferOverflowException.java new file mode 100644 index 0000000000..d141a82d93 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/BufferOverflowException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio; + + +/** + * Unchecked exception thrown when a relative put operation reaches + * the target buffer's limit. + * + * @since 1.4 + */ + +public class BufferOverflowException + extends RuntimeException +{ + + private static final long serialVersionUID = -5484897634319144535L; + + /** + * Constructs an instance of this class. + */ + public BufferOverflowException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/BufferUnderflowException.java b/src/IKVM.Java/local/java/nio/BufferUnderflowException.java new file mode 100644 index 0000000000..d7a062a336 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/BufferUnderflowException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio; + + +/** + * Unchecked exception thrown when a relative get operation reaches + * the source buffer's limit. + * + * @since 1.4 + */ + +public class BufferUnderflowException + extends RuntimeException +{ + + private static final long serialVersionUID = -1713313658691622206L; + + /** + * Constructs an instance of this class. + */ + public BufferUnderflowException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/InvalidMarkException.java b/src/IKVM.Java/local/java/nio/InvalidMarkException.java new file mode 100644 index 0000000000..ed1a059f1e --- /dev/null +++ b/src/IKVM.Java/local/java/nio/InvalidMarkException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio; + + +/** + * Unchecked exception thrown when an attempt is made to reset a buffer + * when its mark is not defined. + * + * @since 1.4 + */ + +public class InvalidMarkException + extends IllegalStateException +{ + + private static final long serialVersionUID = 1698329710438510774L; + + /** + * Constructs an instance of this class. + */ + public InvalidMarkException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/ReadOnlyBufferException.java b/src/IKVM.Java/local/java/nio/ReadOnlyBufferException.java new file mode 100644 index 0000000000..5eb4b95c05 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/ReadOnlyBufferException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio; + + +/** + * Unchecked exception thrown when a content-mutation method such as + * put or compact is invoked upon a read-only buffer. + * + * @since 1.4 + */ + +public class ReadOnlyBufferException + extends UnsupportedOperationException +{ + + private static final long serialVersionUID = -1210063976496234090L; + + /** + * Constructs an instance of this class. + */ + public ReadOnlyBufferException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/AcceptPendingException.java b/src/IKVM.Java/local/java/nio/channels/AcceptPendingException.java new file mode 100644 index 0000000000..dc357f090c --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/AcceptPendingException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to initiate an accept + * operation on a channel and a previous accept operation has not completed. + * + * @since 1.7 + */ + +public class AcceptPendingException + extends IllegalStateException +{ + + private static final long serialVersionUID = 2721339977965416421L; + + /** + * Constructs an instance of this class. + */ + public AcceptPendingException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/AlreadyBoundException.java b/src/IKVM.Java/local/java/nio/channels/AlreadyBoundException.java new file mode 100644 index 0000000000..38d10336fe --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/AlreadyBoundException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to bind the socket a + * network oriented channel that is already bound. + * + * @since 1.7 + */ + +public class AlreadyBoundException + extends IllegalStateException +{ + + private static final long serialVersionUID = 6796072983322737592L; + + /** + * Constructs an instance of this class. + */ + public AlreadyBoundException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/AlreadyConnectedException.java b/src/IKVM.Java/local/java/nio/channels/AlreadyConnectedException.java new file mode 100644 index 0000000000..931efffef4 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/AlreadyConnectedException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to connect a {@link + * SocketChannel} that is already connected. + * + * @since 1.4 + */ + +public class AlreadyConnectedException + extends IllegalStateException +{ + + private static final long serialVersionUID = -7331895245053773357L; + + /** + * Constructs an instance of this class. + */ + public AlreadyConnectedException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/AsynchronousCloseException.java b/src/IKVM.Java/local/java/nio/channels/AsynchronousCloseException.java new file mode 100644 index 0000000000..6fb5e57227 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/AsynchronousCloseException.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Checked exception received by a thread when another thread closes the + * channel or the part of the channel upon which it is blocked in an I/O + * operation. + * + * @since 1.4 + */ + +public class AsynchronousCloseException + extends ClosedChannelException +{ + + private static final long serialVersionUID = 6891178312432313966L; + + /** + * Constructs an instance of this class. + */ + public AsynchronousCloseException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/CancelledKeyException.java b/src/IKVM.Java/local/java/nio/channels/CancelledKeyException.java new file mode 100644 index 0000000000..b5306f04e8 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/CancelledKeyException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to use + * a selection key that is no longer valid. + * + * @since 1.4 + */ + +public class CancelledKeyException + extends IllegalStateException +{ + + private static final long serialVersionUID = -8438032138028814268L; + + /** + * Constructs an instance of this class. + */ + public CancelledKeyException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/ClosedByInterruptException.java b/src/IKVM.Java/local/java/nio/channels/ClosedByInterruptException.java new file mode 100644 index 0000000000..848ee610d3 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/ClosedByInterruptException.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Checked exception received by a thread when another thread interrupts it + * while it is blocked in an I/O operation upon a channel. Before this + * exception is thrown the channel will have been closed and the interrupt + * status of the previously-blocked thread will have been set. + * + * @since 1.4 + */ + +public class ClosedByInterruptException + extends AsynchronousCloseException +{ + + private static final long serialVersionUID = -4488191543534286750L; + + /** + * Constructs an instance of this class. + */ + public ClosedByInterruptException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/ClosedChannelException.java b/src/IKVM.Java/local/java/nio/channels/ClosedChannelException.java new file mode 100644 index 0000000000..a9a2277bd7 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/ClosedChannelException.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Checked exception thrown when an attempt is made to invoke or complete an + * I/O operation upon channel that is closed, or at least closed to that + * operation. That this exception is thrown does not necessarily imply that + * the channel is completely closed. A socket channel whose write half has + * been shut down, for example, may still be open for reading. + * + * @since 1.4 + */ + +public class ClosedChannelException + extends java.io.IOException +{ + + private static final long serialVersionUID = 882777185433553857L; + + /** + * Constructs an instance of this class. + */ + public ClosedChannelException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/ClosedSelectorException.java b/src/IKVM.Java/local/java/nio/channels/ClosedSelectorException.java new file mode 100644 index 0000000000..f3168c2b40 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/ClosedSelectorException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to invoke an I/O + * operation upon a closed selector. + * + * @since 1.4 + */ + +public class ClosedSelectorException + extends IllegalStateException +{ + + private static final long serialVersionUID = 6466297122317847835L; + + /** + * Constructs an instance of this class. + */ + public ClosedSelectorException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/ConnectionPendingException.java b/src/IKVM.Java/local/java/nio/channels/ConnectionPendingException.java new file mode 100644 index 0000000000..c43927edc2 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/ConnectionPendingException.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to connect a {@link + * SocketChannel} for which a non-blocking connection operation is already in + * progress. + * + * @since 1.4 + */ + +public class ConnectionPendingException + extends IllegalStateException +{ + + private static final long serialVersionUID = 2008393366501760879L; + + /** + * Constructs an instance of this class. + */ + public ConnectionPendingException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/FileLockInterruptionException.java b/src/IKVM.Java/local/java/nio/channels/FileLockInterruptionException.java new file mode 100644 index 0000000000..a9b1bd6eb6 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/FileLockInterruptionException.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Checked exception received by a thread when another thread interrupts it + * while it is waiting to acquire a file lock. Before this exception is thrown + * the interrupt status of the previously-blocked thread will have been set. + * + * @since 1.4 + */ + +public class FileLockInterruptionException + extends java.io.IOException +{ + + private static final long serialVersionUID = 7104080643653532383L; + + /** + * Constructs an instance of this class. + */ + public FileLockInterruptionException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/IllegalBlockingModeException.java b/src/IKVM.Java/local/java/nio/channels/IllegalBlockingModeException.java new file mode 100644 index 0000000000..19d03000e7 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/IllegalBlockingModeException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when a blocking-mode-specific operation + * is invoked upon a channel in the incorrect blocking mode. + * + * @since 1.4 + */ + +public class IllegalBlockingModeException + extends IllegalStateException +{ + + private static final long serialVersionUID = -3335774961855590474L; + + /** + * Constructs an instance of this class. + */ + public IllegalBlockingModeException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/IllegalChannelGroupException.java b/src/IKVM.Java/local/java/nio/channels/IllegalChannelGroupException.java new file mode 100644 index 0000000000..dd47105829 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/IllegalChannelGroupException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to open a channel + * in a group that was not created by the same provider. + * + * @since 1.7 + */ + +public class IllegalChannelGroupException + extends IllegalArgumentException +{ + + private static final long serialVersionUID = -2495041211157744253L; + + /** + * Constructs an instance of this class. + */ + public IllegalChannelGroupException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/IllegalSelectorException.java b/src/IKVM.Java/local/java/nio/channels/IllegalSelectorException.java new file mode 100644 index 0000000000..b10f0715b6 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/IllegalSelectorException.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to register a channel + * with a selector that was not created by the provider that created the + * channel. + * + * @since 1.4 + */ + +public class IllegalSelectorException + extends IllegalArgumentException +{ + + private static final long serialVersionUID = -8406323347253320987L; + + /** + * Constructs an instance of this class. + */ + public IllegalSelectorException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/InterruptedByTimeoutException.java b/src/IKVM.Java/local/java/nio/channels/InterruptedByTimeoutException.java new file mode 100644 index 0000000000..ae2018d101 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/InterruptedByTimeoutException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Checked exception received by a thread when a timeout elapses before an + * asynchronous operation completes. + * + * @since 1.7 + */ + +public class InterruptedByTimeoutException + extends java.io.IOException +{ + + private static final long serialVersionUID = -4268008601014042947L; + + /** + * Constructs an instance of this class. + */ + public InterruptedByTimeoutException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/NoConnectionPendingException.java b/src/IKVM.Java/local/java/nio/channels/NoConnectionPendingException.java new file mode 100644 index 0000000000..cea5ad1120 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/NoConnectionPendingException.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when the {@link SocketChannel#finishConnect + * finishConnect} method of a {@link SocketChannel} is invoked without first + * successfully invoking its {@link SocketChannel#connect connect} method. + * + * @since 1.4 + */ + +public class NoConnectionPendingException + extends IllegalStateException +{ + + private static final long serialVersionUID = -8296561183633134743L; + + /** + * Constructs an instance of this class. + */ + public NoConnectionPendingException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/NonReadableChannelException.java b/src/IKVM.Java/local/java/nio/channels/NonReadableChannelException.java new file mode 100644 index 0000000000..ddfa7fa85d --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/NonReadableChannelException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to read + * from a channel that was not originally opened for reading. + * + * @since 1.4 + */ + +public class NonReadableChannelException + extends IllegalStateException +{ + + private static final long serialVersionUID = -3200915679294993514L; + + /** + * Constructs an instance of this class. + */ + public NonReadableChannelException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/NonWritableChannelException.java b/src/IKVM.Java/local/java/nio/channels/NonWritableChannelException.java new file mode 100644 index 0000000000..17c90f314e --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/NonWritableChannelException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to write + * to a channel that was not originally opened for writing. + * + * @since 1.4 + */ + +public class NonWritableChannelException + extends IllegalStateException +{ + + private static final long serialVersionUID = -7071230488279011621L; + + /** + * Constructs an instance of this class. + */ + public NonWritableChannelException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/NotYetBoundException.java b/src/IKVM.Java/local/java/nio/channels/NotYetBoundException.java new file mode 100644 index 0000000000..b6c6af366f --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/NotYetBoundException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to invoke an I/O + * operation upon a server socket channel that is not yet bound. + * + * @since 1.4 + */ + +public class NotYetBoundException + extends IllegalStateException +{ + + private static final long serialVersionUID = 4640999303950202242L; + + /** + * Constructs an instance of this class. + */ + public NotYetBoundException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/NotYetConnectedException.java b/src/IKVM.Java/local/java/nio/channels/NotYetConnectedException.java new file mode 100644 index 0000000000..9e56d07659 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/NotYetConnectedException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to invoke an I/O + * operation upon a socket channel that is not yet connected. + * + * @since 1.4 + */ + +public class NotYetConnectedException + extends IllegalStateException +{ + + private static final long serialVersionUID = 4697316551909513464L; + + /** + * Constructs an instance of this class. + */ + public NotYetConnectedException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/OverlappingFileLockException.java b/src/IKVM.Java/local/java/nio/channels/OverlappingFileLockException.java new file mode 100644 index 0000000000..7dd8f24a7a --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/OverlappingFileLockException.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to acquire a lock on a + * region of a file that overlaps a region already locked by the same Java + * virtual machine, or when another thread is already waiting to lock an + * overlapping region of the same file. + * + * @since 1.4 + */ + +public class OverlappingFileLockException + extends IllegalStateException +{ + + private static final long serialVersionUID = 2047812138163068433L; + + /** + * Constructs an instance of this class. + */ + public OverlappingFileLockException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/ReadPendingException.java b/src/IKVM.Java/local/java/nio/channels/ReadPendingException.java new file mode 100644 index 0000000000..770c9dec81 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/ReadPendingException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to read from an + * asynchronous socket channel and a previous read has not completed. + * + * @since 1.7 + */ + +public class ReadPendingException + extends IllegalStateException +{ + + private static final long serialVersionUID = 1986315242191227217L; + + /** + * Constructs an instance of this class. + */ + public ReadPendingException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/ShutdownChannelGroupException.java b/src/IKVM.Java/local/java/nio/channels/ShutdownChannelGroupException.java new file mode 100644 index 0000000000..b4e4b7decc --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/ShutdownChannelGroupException.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to construct a channel in + * a group that is shutdown or the completion handler for an I/O operation + * cannot be invoked because the channel group has terminated. + * + * @since 1.7 + */ + +public class ShutdownChannelGroupException + extends IllegalStateException +{ + + private static final long serialVersionUID = -3903801676350154157L; + + /** + * Constructs an instance of this class. + */ + public ShutdownChannelGroupException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/UnresolvedAddressException.java b/src/IKVM.Java/local/java/nio/channels/UnresolvedAddressException.java new file mode 100644 index 0000000000..f5e61b8052 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/UnresolvedAddressException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to invoke a network + * operation upon an unresolved socket address. + * + * @since 1.4 + */ + +public class UnresolvedAddressException + extends IllegalArgumentException +{ + + private static final long serialVersionUID = 6136959093620794148L; + + /** + * Constructs an instance of this class. + */ + public UnresolvedAddressException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/UnsupportedAddressTypeException.java b/src/IKVM.Java/local/java/nio/channels/UnsupportedAddressTypeException.java new file mode 100644 index 0000000000..9c88b89c73 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/UnsupportedAddressTypeException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to bind or connect + * to a socket address of a type that is not supported. + * + * @since 1.4 + */ + +public class UnsupportedAddressTypeException + extends IllegalArgumentException +{ + + private static final long serialVersionUID = -2964323842829700493L; + + /** + * Constructs an instance of this class. + */ + public UnsupportedAddressTypeException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/channels/WritePendingException.java b/src/IKVM.Java/local/java/nio/channels/WritePendingException.java new file mode 100644 index 0000000000..89577028cc --- /dev/null +++ b/src/IKVM.Java/local/java/nio/channels/WritePendingException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.channels; + + +/** + * Unchecked exception thrown when an attempt is made to write to an + * asynchronous socket channel and a previous write has not completed. + * + * @since 1.7 + */ + +public class WritePendingException + extends IllegalStateException +{ + + private static final long serialVersionUID = 7031871839266032276L; + + /** + * Constructs an instance of this class. + */ + public WritePendingException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/charset/CharacterCodingException.java b/src/IKVM.Java/local/java/nio/charset/CharacterCodingException.java new file mode 100644 index 0000000000..1cfeb5fbf4 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/charset/CharacterCodingException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.charset; + + +/** + * Checked exception thrown when a character encoding + * or decoding error occurs. + * + * @since 1.4 + */ + +public class CharacterCodingException + extends java.io.IOException +{ + + private static final long serialVersionUID = 8421532232154627783L; + + /** + * Constructs an instance of this class. + */ + public CharacterCodingException() { } + +} diff --git a/src/IKVM.Java/local/java/nio/charset/IllegalCharsetNameException.java b/src/IKVM.Java/local/java/nio/charset/IllegalCharsetNameException.java new file mode 100644 index 0000000000..9124282537 --- /dev/null +++ b/src/IKVM.Java/local/java/nio/charset/IllegalCharsetNameException.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.charset; + + +/** + * Unchecked exception thrown when a string that is not a + * legal charset name is used as such. + * + * @since 1.4 + */ + +public class IllegalCharsetNameException + extends IllegalArgumentException +{ + + private static final long serialVersionUID = 1457525358470002989L; + + private String charsetName; + + /** + * Constructs an instance of this class. + * + * @param charsetName + * The illegal charset name + */ + public IllegalCharsetNameException(String charsetName) { + super(String.valueOf(charsetName)); + this.charsetName = charsetName; + } + + /** + * Retrieves the illegal charset name. + * + * @return The illegal charset name + */ + public String getCharsetName() { + return charsetName; + } + +} diff --git a/src/IKVM.Java/local/java/nio/charset/UnsupportedCharsetException.java b/src/IKVM.Java/local/java/nio/charset/UnsupportedCharsetException.java new file mode 100644 index 0000000000..1774fc08ff --- /dev/null +++ b/src/IKVM.Java/local/java/nio/charset/UnsupportedCharsetException.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// -- This file was mechanically generated: Do not edit! -- // + +package java.nio.charset; + + +/** + * Unchecked exception thrown when no support is available + * for a requested charset. + * + * @since 1.4 + */ + +public class UnsupportedCharsetException + extends IllegalArgumentException +{ + + private static final long serialVersionUID = 1490765524727386367L; + + private String charsetName; + + /** + * Constructs an instance of this class. + * + * @param charsetName + * The name of the unsupported charset + */ + public UnsupportedCharsetException(String charsetName) { + super(String.valueOf(charsetName)); + this.charsetName = charsetName; + } + + /** + * Retrieves the name of the unsupported charset. + * + * @return The name of the unsupported charset + */ + public String getCharsetName() { + return charsetName; + } + +} diff --git a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs b/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs deleted file mode 100644 index 7edc257eba..0000000000 --- a/src/IKVM.MSBuild.Tasks/IkvmUnixExec.cs +++ /dev/null @@ -1,303 +0,0 @@ -namespace IKVM.MSBuild.Tasks -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Resources; - using System.Runtime.InteropServices; - using System.Text; - using System.Threading; - using System.Threading.Tasks; - - using CliWrap; - using CliWrap.Builders; - - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// Task to execute a Unix shell script. - /// - public class IkvmUnixExec : IkvmAsyncTask - { - - /// - /// Script to be run on a Unix shell. - /// - [Required] - public string Command { get; set; } - - /// - /// Optionally, additional arguments to add to the command. If empty, the Command will be treated as a single command line. - /// - public ITaskItem[] Arguments { get; set; } - - /// - /// If on Windows, allow WSL to be used. Paths and commands need to be previously converted to Unix paths. - /// - public bool UseWsl { get; set; } = true; - - /// - /// Optionally the distribution to use. - /// - public string WslDistributionName { get; set; } - - /// - /// Path to the working directory. - /// - public string WorkingDirectory { get; set; } - - /// - /// Gets the set of environmental variables to apply. Each ItemSpec represents a name, with the Value metadata representing a value. - /// - public ITaskItem[] EnvironmentVariables { get; set; } - - /// - /// Whether or not to capture the standard output of the command. - /// - public bool RedirectStandardOutput { get; set; } = false; - - /// - /// Whether or not to log standard output of the command. - /// - public bool LogStandardOutput { get; set; } = true; - - /// - /// Log level at which to emit standard output messages. - /// - public string StandardOutputLogLevel { get; set; } - - /// - /// Whether or not to capture the standard error of the command. - /// - public bool RedirectStandardError { get; set; } = false; - - /// - /// Whether or not to log standard error of the command. - /// - public bool LogStandardError { get; set; } = true; - - /// - /// Log level at which to emit standard error messages. - /// - public string StandardErrorLogLevel { get; set; } - - /// - /// Lines to provide as standard input to the command. - /// - public List StandardInput { get; set; } - - /// - /// Resulting standard output lines. - /// - [Output] - public List StandardOutput { get; set; } - - /// - /// Resulting standard error lines. - /// - [Output] - public List StandardError { get; set; } - - /// - /// Initializes a new instance. - /// - public IkvmUnixExec() - { - - } - - /// - /// Initializes a new instance. - /// - /// - public IkvmUnixExec(ResourceManager taskResources) : - base(taskResources) - { - - } - - /// - /// Initializes a new instance. - /// - /// - /// - public IkvmUnixExec(ResourceManager taskResources, string helpKeywordPrefix) : - base(taskResources, helpKeywordPrefix) - { - - } - - /// - /// Executes the task. - /// - /// - /// - protected override async Task ExecuteAsync(CancellationToken cancellationToken) - { - // clear output lists - StandardOutput = new List(); - StandardError = new List(); - - // execute with wsl.exe - var cli = BuildCommand(); - - // add standard input to the command - if (StandardInput != null) - { - // collect standard input lines as a single string - var stdin = new StringBuilder(); - foreach (var i in StandardInput) - stdin.AppendLine(i.ItemSpec); - - // add final string to command - cli = cli.WithStandardInputPipe(PipeSource.FromString(stdin.ToString())); - } - - // capture standard output to output list - var stdout = new List(); - if (RedirectStandardOutput) - stdout.Add(PipeTarget.ToDelegate(s => StandardOutput.Add(new TaskItem(s)))); - if (LogStandardOutput) - stdout.Add(PipeTarget.ToDelegate(s => LogWithLevel(StandardOutputLogLevel, s))); - if (stdout.Count == 1) - cli = cli.WithStandardOutputPipe(stdout[0]); - if (stdout.Count >= 2) - cli = cli.WithStandardOutputPipe(PipeTarget.Merge(stdout)); - - // capture standard error to output list - var stderr = new List(); - if (RedirectStandardError) - stderr.Add(PipeTarget.ToDelegate(s => StandardError.Add(new TaskItem(s)))); - if (LogStandardError) - stderr.Add(PipeTarget.ToDelegate(s => LogWithLevel(StandardErrorLogLevel, s))); - if (stderr.Count == 1) - cli = cli.WithStandardErrorPipe(stderr[0]); - if (stderr.Count >= 2) - cli = cli.WithStandardErrorPipe(PipeTarget.Merge(stderr)); - - // log the environment variables being passed - if (cli.EnvironmentVariables.Count > 0) - { - var s = new StringBuilder(); - foreach (var env in cli.EnvironmentVariables) - s.AppendLine($"env {env.Key}={env.Value}"); - - Log.LogMessage(MessageImportance.Low, s.ToString()); - } - - // log the final command line - Log.LogMessage(MessageImportance.Normal, cli.ToString()); - - // execute executable - var exe = await cli.ExecuteAsync(cancellationToken); - if (exe.ExitCode != 0) - { - Log.LogError("Non-zero exit code running Unix command: {0}", exe.ExitCode); - return false; - } - - return true; - } - - /// - /// Logs the specified message at the given level. - /// - /// - /// - void LogWithLevel(string level, string message) - { - switch (level) - { - case "Warning": - Log.LogWarning(message); - break; - case "Error": - Log.LogError(message); - break; - default: - Log.LogMessage(message); - break; - } - } - - /// - /// Builds a new command. - /// - /// - Command BuildCommand() - { - var cmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl ? Cli.Wrap(GetWslExePath()).WithArguments(BuildWslArguments) : Cli.Wrap(Command).WithArguments(BuildArguments); - cmd = cmd.WithEnvironmentVariables(BuildEnvironmentVariables); - cmd = cmd.WithValidation(CommandResultValidation.None); - - // set working directory, if available - if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory)) - cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); - - return cmd; - } - - /// - /// Gets the path to wsl.exe based on the current environment. - /// - /// - string GetWslExePath() - { - return Environment.ExpandEnvironmentVariables(RuntimeInformation.ProcessArchitecture == Architecture.X86 ? @"%SystemRoot%\Sysnative\wsl.exe" : @"%SystemRoot%\System32\wsl.exe"); - } - - /// - /// Builds the arguments to execute. - /// - /// - void BuildWslArguments(ArgumentsBuilder builder) - { - if (string.IsNullOrEmpty(WslDistributionName) == false) - builder.Add("-d").Add(WslDistributionName); - - builder.Add("-e"); - builder.Add(Command); - BuildArguments(builder); - } - - /// - /// Builds the arguments to execute. - /// - /// - void BuildArguments(ArgumentsBuilder builder) - { - if (Arguments != null) - foreach (var i in Arguments) - builder.Add(i.ItemSpec); - } - - /// - /// Builds the environment variables. - /// - /// - void BuildEnvironmentVariables(EnvironmentVariablesBuilder builder) - { - if (EnvironmentVariables == null) - return; - - foreach (var env in EnvironmentVariables) - if (env.ItemSpec != null) - builder.Set(env.ItemSpec, env.GetMetadata("Value") ?? ""); - - // WSL requires a WSLENV variable to determine which values pass to the process - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && UseWsl) - { - // record each variable - var wslenv = new List(); - foreach (var env in EnvironmentVariables) - if (env.ItemSpec != null) - wslenv.Add(env.ItemSpec); - - builder.Set("WSLENV", string.Join(":", wslenv)); - } - } - - } - -} diff --git a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs b/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs deleted file mode 100644 index aa078d756d..0000000000 --- a/src/IKVM.MSBuild.Tasks/IkvmWslPath.cs +++ /dev/null @@ -1,117 +0,0 @@ -namespace IKVM.MSBuild.Tasks -{ - using System; - using System.IO; - using System.Resources; - using System.Runtime.InteropServices; - using System.Threading; - using System.Threading.Tasks; - - using CliWrap; - using CliWrap.Builders; - - using Microsoft.Build.Framework; - - /// - /// Task to convert a Windows path to a WSL path. - /// - public class IkvmWslPath : IkvmAsyncTask - { - - /// - /// Path to convert. - /// - [Required] - [Output] - public string Path { get; set; } - - /// - /// Optional name of the distro to use. - /// - public string DistributionName { get; set; } - - /// - /// Initializes a new instance. - /// - public IkvmWslPath() - { - - } - - /// - /// Initializes a new instance. - /// - /// - public IkvmWslPath(ResourceManager taskResources) : - base(taskResources) - { - - } - - /// - /// Initializes a new instance. - /// - /// - /// - public IkvmWslPath(ResourceManager taskResources, string helpKeywordPrefix) : - base(taskResources, helpKeywordPrefix) - { - - } - - /// - /// Executes the task. - /// - /// - protected override async Task ExecuteAsync(CancellationToken cancellationToken) - { - var cmd = Cli.Wrap(GetWslExePath()) - .WithArguments(AddArguments) - .WithStandardOutputPipe(PipeTarget.ToDelegate(TrySetPath)); - - // start at recorded working directory in case of relative path - if (string.IsNullOrEmpty(CurrentWorkingDirectory) == false && Directory.Exists(CurrentWorkingDirectory) == true) - cmd = cmd.WithWorkingDirectory(CurrentWorkingDirectory); - - Log.LogCommandLine(cmd.ToString()); - var exe = await cmd.ExecuteAsync(cancellationToken); - - return true; - } - - /// - /// Gets the path to wsl.exe based on the current environment. - /// - /// - string GetWslExePath() - { - return Environment.ExpandEnvironmentVariables(RuntimeInformation.ProcessArchitecture == Architecture.X86 ? @"%SystemRoot%\Sysnative\wsl.exe" : @"%SystemRoot%\System32\wsl.exe"); - } - - /// - /// Attempts to set the path. - /// - /// - void TrySetPath(string arg) - { - if (string.IsNullOrWhiteSpace(arg) == false) - Path = arg; - } - - /// - /// Adds the arguments for 'wslpath'. - /// - /// - void AddArguments(ArgumentsBuilder builder) - { - if (string.IsNullOrEmpty(DistributionName) == false) - builder.Add("-d").Add(DistributionName); - - builder.Add("-e"); - builder.Add("wslpath"); - builder.Add(Path.Replace("\\", "\\\\"), true); - } - - } - -} From d7f3618da772489b4505b47d515f82513a8d4055 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 12:14:45 -0600 Subject: [PATCH 33/41] Revert draft change. Remove build deps. --- .github/workflows/IKVM.yml | 1 + IKVM.sln | 51 ++++++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index cafa7757aa..548ae9a3e8 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -750,6 +750,7 @@ jobs: tag: ${{ github.ref_name }} allowUpdates: true omitBodyDuringUpdate: true + draft: false artifacts: dist/nuget/*.nupkg,dist/bin/*.zip,dist/bin/*.tar.gz,dist/image/*.zip,dist/image/*.tar.gz,dist/tools/*.zip,dist/tools/*.tar.gz,dist/doc.zip token: ${{ secrets.GITHUB_TOKEN }} - name: Push NuGet (GitHub) diff --git a/IKVM.sln b/IKVM.sln index 2b368920cb..8d200dc49f 100644 --- a/IKVM.sln +++ b/IKVM.sln @@ -113,25 +113,39 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wsimport", "src\wsimport\wsimport.msbuildproj", "{004561E2-DED0-464D-A7B9-85D98281FED4}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.linux-x64", "src\IKVM.Image.JRE.runtime.linux-x64\IKVM.Image.JRE.runtime.linux-x64.csproj", "{8068292D-8B2E-417B-B7CE-0E7159881C50}" + ProjectSection(ProjectDependencies) = postProject + {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.win-x64", "src\IKVM.Image.JRE.runtime.win-x64\IKVM.Image.JRE.runtime.win-x64.csproj", "{27D0142E-7643-4E64-A6B2-995E76EF00A2}" + ProjectSection(ProjectDependencies) = postProject + {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.linux-x64", "src\IKVM.Image.JDK.runtime.linux-x64\IKVM.Image.JDK.runtime.linux-x64.csproj", "{BE31AC7C-79CC-4180-A5E8-BEB3FD7579DC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.win-x64", "src\IKVM.Image.JDK.runtime.win-x64\IKVM.Image.JDK.runtime.win-x64.csproj", "{71444CB1-778F-4DD5-9BDF-ACB310C97345}" + ProjectSection(ProjectDependencies) = postProject + {CCE3DE31-5DE7-4157-90D1-BAFA08C181EC} = {CCE3DE31-5DE7-4157-90D1-BAFA08C181EC} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image", "src\IKVM.Image\IKVM.Image.csproj", "{95C8865C-AB87-4998-880E-38B7F76BAC57}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE.runtime.win-x86", "src\IKVM.Image.JRE.runtime.win-x86\IKVM.Image.JRE.runtime.win-x86.csproj", "{CBB5E3B3-2B0F-41F3-8110-FDD9614FCE5D}" + ProjectSection(ProjectDependencies) = postProject + {162A1F6D-7752-4686-A6C2-923633F4E4C0} = {162A1F6D-7752-4686-A6C2-923633F4E4C0} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK.runtime.win-x86", "src\IKVM.Image.JDK.runtime.win-x86\IKVM.Image.JDK.runtime.win-x86.csproj", "{3E91FECF-80C0-463C-AD62-40062E0D313F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JDK-bin", "src\IKVM.Image.JDK-bin\IKVM.Image.JDK-bin.csproj", "{CCE3DE31-5DE7-4157-90D1-BAFA08C181EC}" - ProjectSection(ProjectDependencies) = postProject - {B60EC8AA-3CDF-45E4-9ACD-3246B375C027} = {B60EC8AA-3CDF-45E4-9ACD-3246B375C027} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Image.JRE-bin", "src\IKVM.Image.JRE-bin\IKVM.Image.JRE-bin.csproj", "{162A1F6D-7752-4686-A6C2-923633F4E4C0}" + ProjectSection(ProjectDependencies) = postProject + {4F7D51D0-F52D-46EF-94DF-C4081587FBB4} = {4F7D51D0-F52D-46EF-94DF-C4081587FBB4} + {7C7BCE2E-88CE-4EA8-863E-37F6B8A824C4} = {7C7BCE2E-88CE-4EA8-863E-37F6B8A824C4} + {B2EF307F-90AA-4CFE-B7F3-FF741545E35B} = {B2EF307F-90AA-4CFE-B7F3-FF741545E35B} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "javac-ref", "src\javac-ref\javac-ref.msbuildproj", "{5DC963FD-6742-47BB-BC96-365B82F73C88}" EndProject @@ -288,11 +302,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Reflection.Tests", "sr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.Java.Tests.Util", "src\IKVM.Java.Tests.Util\IKVM.Java.Tests.Util.csproj", "{00AFE142-5F4F-48DD-90C1-20CC0512C43C}" EndProject -Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libjsound", "src\libjsound\libjsound.clangproj", "{19A2D00A-7BAB-4C04-8D05-8753A70E366A}" +Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libjsound", "src\libjsound\libjsound.clangproj", "{403E0642-B6ED-464E-8694-2E467CDA2C02}" +EndProject +Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libjsoundalsa", "src\libjsoundalsa\libjsoundalsa.clangproj", "{555CDB6E-84CE-4FE8-8945-47553C4D0A51}" EndProject -Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libjsoundalsa", "src\libjsoundalsa\libjsoundalsa.clangproj", "{012FF3AD-F664-4273-8A9D-056CD3C7D161}" +Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libjsoundds", "src\libjsoundds\libjsoundds.clangproj", "{30B763A2-A59A-4CE8-B11E-DD49527480CB}" EndProject -Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libjsoundds", "src\libjsoundds\libjsoundds.clangproj", "{6B4C1863-85CB-4C8C-8F7A-F5F0A7DCC3B0}" Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libosxapp", "src\libosxapp\libosxapp.clangproj", "{0E068B20-9C99-45C5-8D94-A1FF9EDD6739}" EndProject Global @@ -789,18 +804,18 @@ Global {00AFE142-5F4F-48DD-90C1-20CC0512C43C}.Debug|Any CPU.Build.0 = Debug|Any CPU {00AFE142-5F4F-48DD-90C1-20CC0512C43C}.Release|Any CPU.ActiveCfg = Release|Any CPU {00AFE142-5F4F-48DD-90C1-20CC0512C43C}.Release|Any CPU.Build.0 = Release|Any CPU - {19A2D00A-7BAB-4C04-8D05-8753A70E366A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {19A2D00A-7BAB-4C04-8D05-8753A70E366A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19A2D00A-7BAB-4C04-8D05-8753A70E366A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {19A2D00A-7BAB-4C04-8D05-8753A70E366A}.Release|Any CPU.Build.0 = Release|Any CPU - {012FF3AD-F664-4273-8A9D-056CD3C7D161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {012FF3AD-F664-4273-8A9D-056CD3C7D161}.Debug|Any CPU.Build.0 = Debug|Any CPU - {012FF3AD-F664-4273-8A9D-056CD3C7D161}.Release|Any CPU.ActiveCfg = Release|Any CPU - {012FF3AD-F664-4273-8A9D-056CD3C7D161}.Release|Any CPU.Build.0 = Release|Any CPU - {6B4C1863-85CB-4C8C-8F7A-F5F0A7DCC3B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6B4C1863-85CB-4C8C-8F7A-F5F0A7DCC3B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6B4C1863-85CB-4C8C-8F7A-F5F0A7DCC3B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6B4C1863-85CB-4C8C-8F7A-F5F0A7DCC3B0}.Release|Any CPU.Build.0 = Release|Any CPU + {403E0642-B6ED-464E-8694-2E467CDA2C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {403E0642-B6ED-464E-8694-2E467CDA2C02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {403E0642-B6ED-464E-8694-2E467CDA2C02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {403E0642-B6ED-464E-8694-2E467CDA2C02}.Release|Any CPU.Build.0 = Release|Any CPU + {555CDB6E-84CE-4FE8-8945-47553C4D0A51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {555CDB6E-84CE-4FE8-8945-47553C4D0A51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {555CDB6E-84CE-4FE8-8945-47553C4D0A51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {555CDB6E-84CE-4FE8-8945-47553C4D0A51}.Release|Any CPU.Build.0 = Release|Any CPU + {30B763A2-A59A-4CE8-B11E-DD49527480CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30B763A2-A59A-4CE8-B11E-DD49527480CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30B763A2-A59A-4CE8-B11E-DD49527480CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30B763A2-A59A-4CE8-B11E-DD49527480CB}.Release|Any CPU.Build.0 = Release|Any CPU {0E068B20-9C99-45C5-8D94-A1FF9EDD6739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0E068B20-9C99-45C5-8D94-A1FF9EDD6739}.Debug|Any CPU.Build.0 = Debug|Any CPU {0E068B20-9C99-45C5-8D94-A1FF9EDD6739}.Release|Any CPU.ActiveCfg = Release|Any CPU From 7db1a9c7a7440054bd69d9a9bbb5fc6f8e330adf Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 12:17:30 -0600 Subject: [PATCH 34/41] After --- .github/workflows/IKVM.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index 548ae9a3e8..1442e84b6b 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -750,8 +750,8 @@ jobs: tag: ${{ github.ref_name }} allowUpdates: true omitBodyDuringUpdate: true - draft: false artifacts: dist/nuget/*.nupkg,dist/bin/*.zip,dist/bin/*.tar.gz,dist/image/*.zip,dist/image/*.tar.gz,dist/tools/*.zip,dist/tools/*.tar.gz,dist/doc.zip + draft: false token: ${{ secrets.GITHUB_TOKEN }} - name: Push NuGet (GitHub) if: github.event_name != 'pull_request' From 8c6f5d0f2bb74c941b5271292b9cb540f50b17bd Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 12:36:58 -0600 Subject: [PATCH 35/41] Remove WSL. Can probably get away without it. Put R2R back? --- .github/workflows/IKVM.yml | 3 --- src/ikvmc/ikvmc.csproj | 1 + src/ikvmstub/ikvmstub.csproj | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/IKVM.yml b/.github/workflows/IKVM.yml index 1442e84b6b..4119a77dd6 100644 --- a/.github/workflows/IKVM.yml +++ b/.github/workflows/IKVM.yml @@ -145,9 +145,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x - - name: Setup WSL - if: runner.os == 'Windows' - uses: Vampire/setup-wsl@v2 - name: Cache LLVM and Clang id: cache-llvm uses: actions/cache@v3 diff --git a/src/ikvmc/ikvmc.csproj b/src/ikvmc/ikvmc.csproj index 97087a3833..ad17ab129b 100644 --- a/src/ikvmc/ikvmc.csproj +++ b/src/ikvmc/ikvmc.csproj @@ -3,6 +3,7 @@ Exe net6.0;net472 $(_SupportedToolRuntimes) + true diff --git a/src/ikvmstub/ikvmstub.csproj b/src/ikvmstub/ikvmstub.csproj index 35a75bfb77..0e8f641af8 100644 --- a/src/ikvmstub/ikvmstub.csproj +++ b/src/ikvmstub/ikvmstub.csproj @@ -3,6 +3,7 @@ Exe net472;net6.0 $(_SupportedToolRuntimes) + true From 59fc0df405e3e1069ffc693ead1196fa90c2e026 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 12:40:55 -0600 Subject: [PATCH 36/41] Commit which extends check lifetime. --- openjdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjdk b/openjdk index c6480a5dc5..e0b32f678c 160000 --- a/openjdk +++ b/openjdk @@ -1 +1 @@ -Subproject commit c6480a5dc5340f4e191ac6bb8dc8b173ad44096e +Subproject commit e0b32f678cccdc17aa34d6c9837457628f6aa500 From f1eef2b7e9973748b341cbda024a0439abe1c1bf Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 13:49:17 -0600 Subject: [PATCH 37/41] No need for item groups? --- src/IKVM.Java/IKVM.Java.runtime.targets | 48 ++++++++++++------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.runtime.targets b/src/IKVM.Java/IKVM.Java.runtime.targets index 93f78ff083..2121a83172 100644 --- a/src/IKVM.Java/IKVM.Java.runtime.targets +++ b/src/IKVM.Java/IKVM.Java.runtime.targets @@ -1109,31 +1109,33 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - - <_Src Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_GenBufferCommand.Template).java.template" /> - <_Bin Include="$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_GenBufferCommand.Template)-bin.java.template" /> - <_Tmp Include="$(GenSrc)java\nio\%(_GenBufferCommand.Identity).java.tmp" /> - <_Dst Include="$(GenSrc)java\nio\%(_GenBufferCommand.Identity).java" /> - + + <_Src>$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_GenBufferCommand.Template).java.template + <_Bin>$(OpenJdkDir)jdk\src\share\classes\java\nio\%(_GenBufferCommand.Template)-bin.java.template + <_Tmp>$(GenSrc)java\nio\%(_GenBufferCommand.Identity).java.tmp + <_Dst>$(GenSrc)java\nio\%(_GenBufferCommand.Identity).java + - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + @@ -1156,10 +1158,6 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - - - - From 954a96d2378d35d9baebf566edc129d239dbaad5 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 13:58:45 -0600 Subject: [PATCH 38/41] Clean up stuff on Clean. Depend on targets file itself in most targets so we rerun them on change. --- src/IKVM.Java/IKVM.Java.runtime.targets | 42 +++++++++++++++++-------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/src/IKVM.Java/IKVM.Java.runtime.targets b/src/IKVM.Java/IKVM.Java.runtime.targets index 2121a83172..bd83e75e3f 100644 --- a/src/IKVM.Java/IKVM.Java.runtime.targets +++ b/src/IKVM.Java/IKVM.Java.runtime.targets @@ -140,7 +140,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -306,7 +306,7 @@ - + @@ -349,7 +349,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -668,7 +668,7 @@ public class WriteStandardCharsets : Task - + @@ -704,7 +704,7 @@ public class WriteStandardCharsets : Task - + @@ -742,7 +742,7 @@ public class WriteStandardCharsets : Task - + @@ -1106,7 +1106,7 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - + @@ -1158,7 +1158,7 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - + @@ -1184,11 +1184,15 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN - <_GenSrcJavaResource Include="$(GenSrc)**\*" Exclude="$(GenSrc)jdk\gensrc\**\*.java;$(GenSrc)jdk\gensrc\**\*.class" /> + <_GenSrcJavaResource Include="$(GenSrc)**\*" Exclude="$(GenSrc)**\*.java;$(GenSrc)**\*.class" /> + + + + @@ -1201,6 +1205,10 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN + + + + @@ -1210,6 +1218,14 @@ File.WriteAllLines(Path, File.ReadAllLines(Path).TakeWhile(i => i.Contains("#BIN + + + $(CoreCleanDependsOn); + CleanGenerateSource; + CleanGenerateData; + + + From 285f97f6171e5d6dfec02e644d77baca0b0c95ef Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 14:05:40 -0600 Subject: [PATCH 39/41] Add self as an input item. Makes debugging easier. Design time reruns when you change scripts. --- src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets index c7eb4497ea..5cc973dae0 100644 --- a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets +++ b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets @@ -79,7 +79,7 @@ Items = Items.OrderBy(i => i.ItemSpec).ToArray(); - + @@ -121,7 +121,7 @@ Items = Items.OrderBy(i => i.ItemSpec).ToArray(); - + @@ -167,7 +167,7 @@ Items = Items.OrderBy(i => i.ItemSpec).ToArray(); - + @@ -273,7 +273,7 @@ Items = Items.OrderBy(i => i.ItemSpec).ToArray(); - + From 52ee8b235bd0cb2bc7c1ff054fd0e679a0304214 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 14:09:42 -0600 Subject: [PATCH 40/41] Add self as input to force rebuild. --- src/IKVM/buildTransitive/IKVM.NoTasks.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IKVM/buildTransitive/IKVM.NoTasks.targets b/src/IKVM/buildTransitive/IKVM.NoTasks.targets index 019fd3307f..e62225e2e5 100644 --- a/src/IKVM/buildTransitive/IKVM.NoTasks.targets +++ b/src/IKVM/buildTransitive/IKVM.NoTasks.targets @@ -8,7 +8,7 @@ --> - + From 0a920a7ef9b33d9302b6c6dd55f3bdc63e80fa85 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 10 Feb 2024 14:52:55 -0600 Subject: [PATCH 41/41] Was added as dep accidently. --- src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets index 5cc973dae0..77f4914d54 100644 --- a/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets +++ b/src/IKVM.NET.Sdk/targets/IKVM.Java.Core.NoTasks.targets @@ -121,7 +121,7 @@ Items = Items.OrderBy(i => i.ItemSpec).ToArray(); - +