Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review class generation to avoid the file AllPackageClasses.cs in each namespace #520

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
aa7da7b
Temp
masesdevelopers Aug 29, 2024
ffb10bc
Most exceptions and errors in java.lang will be reflected
masesdevelopers Aug 29, 2024
09473e3
Fix
masesdevelopers Aug 30, 2024
2342c1e
Changes by GitHub action (#517)
github-actions[bot] Aug 30, 2024
5ee6954
Merge branch '513-evaluate-if-it-possible-to-split-classes-shared-wit…
masesdevelopers Aug 30, 2024
6e93502
Merge branch '513-evaluate-if-it-possible-to-split-classes-shared-wit…
masesdevelopers Aug 30, 2024
5b26f87
Moved files to accomplish the JNetCore
masesdevelopers Aug 30, 2024
407d159
Update workflows
masesdevelopers Aug 30, 2024
4c67c5a
Update
masesdevelopers Aug 30, 2024
663ef4b
Artifact update
masesdevelopers Aug 30, 2024
1271afb
Update generation
masesdevelopers Aug 30, 2024
bfa59c9
Update to generate PRs in any case
masesdevelopers Aug 30, 2024
bb430dd
Update generated classes after commit bfa59c9 (#1)
github-actions[bot] Aug 30, 2024
a3ab3a6
Moves class definition in the same file of class implementation tryin…
masesdevelopers Aug 30, 2024
02fda0c
Update generated classes after commit a3ab3a6 (#2)
github-actions[bot] Aug 30, 2024
4ffc03f
Remove extra files
masesdevelopers Aug 30, 2024
0a732e7
Update code generation
masesdevelopers Aug 30, 2024
3493448
Update generated classes after commit 0a732e7 (#3)
github-actions[bot] Aug 30, 2024
7aa9f2e
Update templates
masesdevelopers Aug 31, 2024
315c5b1
Update generated classes after commit 7aa9f2e (#4)
github-actions[bot] Aug 31, 2024
a7871a3
Extra fix
masesdevelopers Sep 2, 2024
dada924
Update generated classes after commit a7871a3 (#5)
github-actions[bot] Sep 2, 2024
4c5a37f
Return back to single JAR
masesdevelopers Sep 2, 2024
5577a55
Cleanup
masesdevelopers Sep 3, 2024
c26358c
Merge remote-tracking branch 'upstream/master' into 513-evaluate-if-i…
masesdevelopers Sep 3, 2024
e104413
Class name alignment to JNetReflector one for nested classes
masesdevelopers Sep 4, 2024
8d2f305
Fix
masesdevelopers Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Create Jars
- name: Create Jars for JNet
run: mvn --file ./src/jvm/jnet/pom.xml --no-transfer-progress package
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Create Jars
- name: Create Jars for JNet
run: mvn --file ./src/jvm/jnet/pom.xml --no-transfer-progress package
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/generateclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Create Jars
- name: Create Jars for JNet
run: mvn "-Djcobridgepath=../../../binReflector/net8.0/JCOBridge.jar" --file ./src/jvm/jnet/pom.xml --no-transfer-progress package
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand All @@ -58,7 +58,9 @@ jobs:
run: Remove-Item .\src\net\JNet\Generated\* -Recurse -Force -Exclude README.md

- name: Clear Java generated files
run: Remove-Item .\src\jvm\jnet\src\main\java\org\mases\jnet\generated\* -Recurse -Force -Exclude README.md
run: |
Remove-Item .\src\jvm\jnetcore\src\main\java\org\mases\jnet\generated\* -Recurse -Force -Exclude README.md
Remove-Item .\src\jvm\jnet\src\main\java\org\mases\jnet\generated\* -Recurse -Force -Exclude README.md

- run: dotnet build --no-incremental --configuration Release src\net\JNetReflector\JNetReflector.csproj

Expand All @@ -75,13 +77,13 @@ jobs:
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" /p:NoWarn="0108%3B1030%3B0618" src\net\JNet.sln

- name: Extract commit SHA
if: ${{ github.repository_owner == 'masesgroup' && inputs.GeneratePR == true }}
if: ${{ inputs.GeneratePR == true }}
run: |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
shell: bash

- name: Request a PR to commit changes
if: ${{ github.repository_owner == 'masesgroup' && inputs.GeneratePR == true }} #do not push any changes outside main repo or GeneratePR is false
if: ${{ inputs.GeneratePR == true }}
uses: peter-evans/create-pull-request@v6
with:
branch-suffix: short-commit-hash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Create Jars
- name: Create Jars for JNet
run: mvn --file ./src/jvm/jnet/pom.xml --no-transfer-progress package
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Create Jars
- name: Create Jars for JNet
run: mvn --file ./src/jvm/jnet/pom.xml --no-transfer-progress package
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Create Jars
- name: Create Jars for JNet
run: mvn --file ./src/jvm/jnet/pom.xml --no-transfer-progress package
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import org.mases.jcobridge.JCObject;

/**
* The {@link UncaughtExceptionHandler} class represents a generic implementation of
* The {@link Thread_UncaughtExceptionHandler} class represents a generic implementation of
* {@link Thread.UncaughtExceptionHandler}
*/
public class UncaughtExceptionHandler extends JCListener implements Thread.UncaughtExceptionHandler {
public UncaughtExceptionHandler(String key) throws JCNativeException {
public class Thread_UncaughtExceptionHandler extends JCListener implements Thread.UncaughtExceptionHandler {
public Thread_UncaughtExceptionHandler(String key) throws JCNativeException {
super(key);
}

Expand Down
3 changes: 3 additions & 0 deletions src/jvm/jnet/src/main/java/org/mases/jnet/generated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Java Generated classes

This folder contains the Java classes generated using JNetReflector at the same version of JNet.
2 changes: 1 addition & 1 deletion src/net/JNet/Developed/Java/Lang/Reflect/WildcardType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ public partial class WildcardType
{

#endif
}
}
}
2 changes: 1 addition & 1 deletion src/net/JNet/Developed/Java/Lang/Thread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class UncaughtExceptionHandler : JVMBridgeListener
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeListener_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => "org.mases.jnet.developed.java.lang.UncaughtExceptionHandler";
public override string BridgeClassName => "org.mases.jnet.developed.java.lang.Thread_UncaughtExceptionHandler";

/// <summary>
/// The <see cref="Action{Thread, JVMBridgeException}"/> to be executed
Expand Down
30 changes: 0 additions & 30 deletions src/net/JNet/Generated/Java/Applet/AllPackageClasses.cs

This file was deleted.

19 changes: 18 additions & 1 deletion src/net/JNet/Generated/Java/Awt/AWTError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,24 @@

namespace Java.Awt
{
#region AWTError
#region AWTError declaration
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/AWTError.html"/>
/// </summary>
public partial class AWTError : Java.Lang.Error
{
const string _bridgeClassName = "java.awt.AWTError";
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeException_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => _bridgeClassName;

// TODO: complete the class

}
#endregion

#region AWTError implementation
public partial class AWTError
{
#region Constructors
Expand Down
49 changes: 48 additions & 1 deletion src/net/JNet/Generated/Java/Awt/AWTEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,54 @@

namespace Java.Awt
{
#region AWTEvent
#region AWTEvent declaration
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/AWTEvent.html"/>
/// </summary>
public partial class AWTEvent : Java.Util.EventObject
{
const string _bridgeClassName = "java.awt.AWTEvent";
/// <summary>
/// Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge
/// </summary>
[global::System.Obsolete("AWTEvent class represents, in .NET, an instance of a JVM interface or abstract class. This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public AWTEvent() { }
/// <summary>
/// Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class
/// </summary>
[global::System.Obsolete("AWTEvent class represents, in .NET, an instance of a JVM interface or abstract class. This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public AWTEvent(params object[] args) : base(args) { }

private static readonly MASES.JCOBridge.C2JBridge.JVMInterop.IJavaType _LocalBridgeClazz = JVMBridgeBase.ClazzOf(_bridgeClassName);
private static MASES.JCOBridge.C2JBridge.JVMInterop.IJavaType LocalBridgeClazz => _LocalBridgeClazz ?? throw new global::System.InvalidOperationException($"Class {_bridgeClassName} was not found.");

/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => _bridgeClassName;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeAbstract.htm"/>
/// </summary>
public override bool IsBridgeAbstract => true;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeCloseable.htm"/>
/// </summary>
public override bool IsBridgeCloseable => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeInterface.htm"/>
/// </summary>
public override bool IsBridgeInterface => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeStatic.htm"/>
/// </summary>
public override bool IsBridgeStatic => false;

// TODO: complete the class

}
#endregion

#region AWTEvent implementation
public partial class AWTEvent
{
#region Constructors
Expand Down
47 changes: 46 additions & 1 deletion src/net/JNet/Generated/Java/Awt/AWTEventMulticaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,52 @@

namespace Java.Awt
{
#region AWTEventMulticaster
#region AWTEventMulticaster declaration
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/AWTEventMulticaster.html"/>
/// </summary>
public partial class AWTEventMulticaster : MASES.JCOBridge.C2JBridge.JVMBridgeBase<AWTEventMulticaster>
{
const string _bridgeClassName = "java.awt.AWTEventMulticaster";
/// <summary>
/// Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge
/// </summary>
public AWTEventMulticaster() { }
/// <summary>
/// Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class
/// </summary>
public AWTEventMulticaster(params object[] args) : base(args) { }

private static readonly MASES.JCOBridge.C2JBridge.JVMInterop.IJavaType _LocalBridgeClazz = JVMBridgeBase.ClazzOf(_bridgeClassName);
private static MASES.JCOBridge.C2JBridge.JVMInterop.IJavaType LocalBridgeClazz => _LocalBridgeClazz ?? throw new global::System.InvalidOperationException($"Class {_bridgeClassName} was not found.");

/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => _bridgeClassName;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeAbstract.htm"/>
/// </summary>
public override bool IsBridgeAbstract => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeCloseable.htm"/>
/// </summary>
public override bool IsBridgeCloseable => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeInterface.htm"/>
/// </summary>
public override bool IsBridgeInterface => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeStatic.htm"/>
/// </summary>
public override bool IsBridgeStatic => false;

// TODO: complete the class

}
#endregion

#region AWTEventMulticaster implementation
public partial class AWTEventMulticaster
{
#region Constructors
Expand Down
19 changes: 18 additions & 1 deletion src/net/JNet/Generated/Java/Awt/AWTException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,24 @@

namespace Java.Awt
{
#region AWTException
#region AWTException declaration
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/AWTException.html"/>
/// </summary>
public partial class AWTException : Java.Lang.Exception
{
const string _bridgeClassName = "java.awt.AWTException";
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeException_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => _bridgeClassName;

// TODO: complete the class

}
#endregion

#region AWTException implementation
public partial class AWTException
{
#region Constructors
Expand Down
47 changes: 46 additions & 1 deletion src/net/JNet/Generated/Java/Awt/AWTKeyStroke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,52 @@

namespace Java.Awt
{
#region AWTKeyStroke
#region AWTKeyStroke declaration
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/AWTKeyStroke.html"/>
/// </summary>
public partial class AWTKeyStroke : Java.Io.Serializable
{
const string _bridgeClassName = "java.awt.AWTKeyStroke";
/// <summary>
/// Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge
/// </summary>
public AWTKeyStroke() { }
/// <summary>
/// Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class
/// </summary>
public AWTKeyStroke(params object[] args) : base(args) { }

private static readonly MASES.JCOBridge.C2JBridge.JVMInterop.IJavaType _LocalBridgeClazz = JVMBridgeBase.ClazzOf(_bridgeClassName);
private static MASES.JCOBridge.C2JBridge.JVMInterop.IJavaType LocalBridgeClazz => _LocalBridgeClazz ?? throw new global::System.InvalidOperationException($"Class {_bridgeClassName} was not found.");

/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_BridgeClassName.htm"/>
/// </summary>
public override string BridgeClassName => _bridgeClassName;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeAbstract.htm"/>
/// </summary>
public override bool IsBridgeAbstract => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeCloseable.htm"/>
/// </summary>
public override bool IsBridgeCloseable => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeInterface.htm"/>
/// </summary>
public override bool IsBridgeInterface => false;
/// <summary>
/// <see href="https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_IsBridgeStatic.htm"/>
/// </summary>
public override bool IsBridgeStatic => false;

// TODO: complete the class

}
#endregion

#region AWTKeyStroke implementation
public partial class AWTKeyStroke
{
#region Constructors
Expand Down
Loading