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

How to build and publishToMavenLocal in Linux or Windows? #401

Open
ctoabidmaqbool opened this issue Aug 5, 2024 · 3 comments
Open

How to build and publishToMavenLocal in Linux or Windows? #401

ctoabidmaqbool opened this issue Aug 5, 2024 · 3 comments

Comments

@ctoabidmaqbool
Copy link

The Docs are showing only way to build and publishToMavenLocal on Mac OS!

As everyone can't have acess to Mac, so how to using Linux OS e.g. Ubuntu to do so.

Is windows can be possible too?

At least I think, we can use Linux for this too!

@ctoabidmaqbool
Copy link
Author

When I have tried to run:

./gradlew :display:publishToMavenLocal

I was facing the error:

7:53:18 PM: Executing 'publishToMavenLocal'...

> Task :util:compileJava UP-TO-DATE
> Task :util:processResources UP-TO-DATE
> Task :util:classes UP-TO-DATE
> Task :util:jar UP-TO-DATE
> Task :lifecycle:compileJava UP-TO-DATE
> Task :lifecycle:processResources UP-TO-DATE
> Task :lifecycle:classes UP-TO-DATE
> Task :lifecycle:jar UP-TO-DATE
> Task :display:compileJava UP-TO-DATE
> Task :display:processResources UP-TO-DATE
> Task :display:classes UP-TO-DATE
> Task :display:jar UP-TO-DATE
> Task :display:assemble UP-TO-DATE
> Task :display:compileTestJava NO-SOURCE
> Task :display:processTestResources NO-SOURCE
> Task :display:testClasses UP-TO-DATE
> Task :display:test NO-SOURCE
> Task :display:check UP-TO-DATE
> Task :display:build UP-TO-DATE

> Task :display:androidBuild FAILED
10 actionable tasks: 1 executed, 9 up-to-date
/usr/bin/env: ‘bash\r’: No such file or directory

FAILURE: Build failed with an exception.

* Where:
Script '/mnt/d/JavaFx-Android/attach/gradle/native-build.gradle' line: 216

* What went wrong:
Execution failed for task ':display:androidBuild'.
> Process 'command '/mnt/d/JavaFx-Android/attach/modules/display/build/aar/gradlew'' finished with non-zero exit value 127

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s
7:53:33 PM: Execution finished 'publishToMavenLocal'.

So, I have solved this by editing gradle/native-build.gradle line no. 215 :

import org.apache.tools.ant.taskdefs.condition.Os

// build aar
def gradlewFile = file("$tempDir/gradlew")

if (Os.isFamily(Os.FAMILY_UNIX)) {
    exec {
        commandLine 'dos2unix', gradlewFile.getAbsolutePath()
    }
}

def aarArgs = ["-p", file("$tempDir/library").getAbsolutePath(), "assembleDebug"].flatten()
exec {
    environment ANDROID_HOME: sdk, JAVA_HOME: JAVAHOME
    executable gradlewFile.getAbsolutePath()
    args aarArgs
}

@ctoabidmaqbool
Copy link
Author

ChatGPT refference: https://chatgpt.com/share/a8346b42-3bb1-4e5d-a111-e8f9de9c0f0b

Note: ChatGPT often helps a lot in development stuff.

@ctoabidmaqbool
Copy link
Author

ctoabidmaqbool commented Aug 6, 2024

Same iss in AttachExtended: e.g. git check-out on windows and run commands in Linux (Windows 10 WSL 2.0 -> Ubuntu)
gluonhq/AttachExtended#10

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

No branches or pull requests

1 participant