ipfs-shipyard / gomobile-ipfs

IPFS and libp2p on Mobile, with Gomobile
Other
324 stars 63 forks source link

how to build on Windows 11? Or can you provide built package? #158

Closed zhufengweihai closed 1 year ago

zhufengweihai commented 1 year ago

Asking a question, not reporting a bug

Is there an existing issue for this?

Question

how to build on Windows 11? Or can you provide built package?

Context

build

jefft0 commented 1 year ago

Building for iOS requires Xcode which only works on macOS. Building for Android requires a "Unix-like" environment. I tried building in WSL but the install process requires Android Studio to configure the build tools. The GUI for Android Studio didn't work in WSL. Maybe there are command-line options to configure the Android build tools but I don't know about them.

Are you building for Android? Do you have WSL Ubuntu?

oldfeel commented 1 year ago

The way of executing commands differs between Windows and macOS/Ubuntu, so you need to make a few changes in the Makefile and maven_format_core.py.

In the Makefile, when executing Python code on Windows, you need to prefix the command with "py" and modify the code on line 109 as follows:

    py $(UTIL_MAVEN_FORMAT_CORE_BIN) && touch $(ANDROID_BUILD_DIR_MAV_CORE)

In the Python script (maven_format_core.py), for Windows paths, you need to enclose them in double quotes. Modify the code from line 111 to 123 as follows:

            if os.system('javadoc -Xdoclint:none -quiet -classpath "%s" '
                         '-sourcepath "%s" go core -d %s' %
                         (
                            target_sdk_path,
                            temp_dir,
                            os.path.join(temp_dir, "javadoc")
                         )):
                exit(1)

        # Create a jar containing the javadoc
        if os.system('jar -cf "%s" "%s"' %
                     (os.path.join(temp_dir, javadoc_art), os.path.join(temp_dir, "javadoc"))):
            exit(1)
jefft0 commented 1 year ago

No more questions. Closing as resolved.