Skip to content

Fix: Compile classlib annotations before core sources - #1

Draft
mo-dev-studio-eg wants to merge 1 commit into
masterfrom
fix/classlib-annotation-compilation
Draft

Fix: Compile classlib annotations before core sources#1
mo-dev-studio-eg wants to merge 1 commit into
masterfrom
fix/classlib-annotation-compilation

Conversation

@mo-dev-studio-eg

Copy link
Copy Markdown
Owner

Description

This fix ensures the org.jnode.annotation package is compiled and packaged into classlib.jar before the main core compilation starts.

Problem

The build was failing with errors like:

package org.jnode.annotation does not exist

The org.jnode.annotation package (containing annotations like @MagicPermission, @SharedStatics, @Uninterruptible, etc.) is located in core/src/classlib/org/jnode/annotation/, but these sources were never being compiled into classlib.jar before the main core sources were compiled.

Solution

Modified core/build.xml to:

  1. Added properties for classlib compilation:

    • my-classlib-classes.dir - directory for compiled classlib classes
    • classlib.jar - location for the classlib jar file
  2. Created a new compile-classlib target that:

    • Compiles all sources in core/src/classlib/
    • Packages them into classlib.jar
  3. Updated the compile target to depend on compile-classlib instead of just prepare

This ensures the annotation classes are available in classlib.jar before the main core compilation begins.

Testing

Run: ./build.sh -Djnode.local.classlib=true assemble


This PR was created by an AI agent (OpenHands) on behalf of the user.

@mo-dev-studio-eg can click here to continue refining the PR

This fix ensures the org.jnode.annotation package is compiled and packaged
into classlib.jar before the main core compilation starts.

The build was failing because:
- classlib.jar was expected to contain annotation classes
- But the classlib sources in core/src/classlib/ were never compiled
- This caused 'package org.jnode.annotation does not exist' errors

Changes:
- Add compile-classlib target that compiles classlib sources first
- The compile target now depends on compile-classlib
- classlib.jar is created from the compiled classlib classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants