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

Consistent build tooling for Android and iOS #77

Open
gedw99 opened this issue Jun 11, 2024 · 4 comments
Open

Consistent build tooling for Android and iOS #77

gedw99 opened this issue Jun 11, 2024 · 4 comments

Comments

@gedw99
Copy link

gedw99 commented Jun 11, 2024

It’s hard for a dev to correctly setup their Android and iOS tooling to be able to build and run the simulator.

I have used many different approaches.

https://github.com/worldiety/goup is something I have used in the past.

it’s broken at the moment but its a minor break.

It’s designed for gomobile but can easily be used for gio with some tweaks.

It puts all the huge tooling into 1 folder that is isolated. These are : java, android sdk manager, and manager, etc

This ensures it does not break or mess with any other Android or iOS tooling you have installed already . It then exports the path to those tools so your other tooling like GIO cmd can use it.

You can see the exporting here: https://github.com/worldiety/goup/blob/master/goup.go#L316

So a bit of golang wrapping this can do a gio build and simulator for Android , iOS.

“ Gioup “

I am thinking about extending it to work for gio.

@gedw99
Copy link
Author

gedw99 commented Jun 11, 2024

The system runs on Linux, Mac and Windows too, so any developer can use it.

go install github.com/worldiety/goup@latest

goup -h
Usage of goup:
  -buildFile string
        Use a build file to load. (default "./goup.yaml")
  -clean
        Removes the project workspace, but keeps toolchains.
  -dir string
        Use a custom directory to resolve relative paths from goup.yml. (default "/Users/apple/workspace/go/src/junk/goup")
  -help
        Shows this help
  -home string
        Use this as the home directory, where GoUp holds toolchains, projects and workspaces. (default "/Users/apple/.goup")
  -loglevel int
        The LogLevel determines what is printed into the console. 0=Debug, 1=Info, 2=Warn, 3=Error (default 3)
  -reset
        Performs a reset, delete the home directory and exits
  -resources string
        XML which describes downloadable toolchains (default "https://raw.githubusercontent.com/worldiety/goup/master/resources.xml")
  -targets string
        The targets to build, e.g. gomobile/android or gomobile/ios. Can be concated by : (default "all")
  -version
        Shows the version


# lets install the tools using the https://github.com/worldiety/goup/blob/master/resources.xml as a reference. 
coup .

# list the tools.
ls -al  ~/.goup/toolchains
total 0
drwxr-xr-x   7 apple  staff  224 Jun 10 23:28 .
drwxr-xr-x   6 apple  staff  192 Jun 10 23:24 ..
drwxr-xr-x  19 apple  staff  608 Jun 10 23:25 go-1.17.8
drwxr-xr-x   4 apple  staff  128 Jun 10 23:25 gomobile-wdy-v0.0.2
drwxr-xr-x   3 apple  staff   96 Jun 10 23:28 jdk-8u212b03
drwxr-xr-x  22 apple  staff  704 Jun 10 23:28 ndk-r19c
drwxr-xr-x  13 apple  staff  416 Jun 10 23:28 sdk-4333796

These tools are now installed in an isolated way.

We can now use a gio wrapper to wire up the the coup tools, such that a GIO build ensures the tools are installed at the right version, and exported so that we can call them using gio build.

Another way is to extend or fork coup, to create "gioup". For example, we could add the gio cmd to the resource.xml and have the program install it.

There are a few ways :).

@gedw99
Copy link
Author

gedw99 commented Jun 12, 2024

Hey @inkeliz

would appreciate if you can let me know if you like this idea.

I have already started to make the changes so that it all works with gio and gio- plugins.

The changes are pretty minimal.

I have not committed to my fork yet.
they are not interested in the changes, hence why I am forking .

https://github.com/gedw99/goup

@inkeliz
Copy link
Contributor

inkeliz commented Jun 12, 2024

I don't have any proper opinion about that.

In the past, I used to use Windows, and then SSH to macOS for compilation (with a network-drive mounted), and I have the same process for Android. So, I have one Linux VM and one bash script, since it's network mounted, all system have the same path. Of course, upgrading golang and so on is quite manual, and Android SDK is easier with sdkmanage CLI.

Having multiple Java versions isn't a big deal, you can just reorder your PATH, or create one script for that. My recent issue was due to D8, which is now compiled by Java 11, ironically. Android SDK can be anything, and usually you should use the latest one.

For Windows build (which generates one MSIX) it's more complicated, it not only requires one Windows machine, but we also use a commercial software (Advanced Installer). The macOS also lacks the pkg/dmg installer.

@gedw99
Copy link
Author

gedw99 commented Jun 25, 2024

I don't have any proper opinion about that.

Good to know.. I respond to your comments below. I have not had time yet to complete the work so that GIO can use GOUP yet. Been too busy. I think its quite easy.

In the past, I used to use Windows, and then SSH to macOS for compilation (with a network-drive mounted), and I have the same process for Android. So, I have one Linux VM and one bash script, since it's network mounted, all system have the same path. Of course, upgrading golang and so on is quite manual, and Android SDK is easier with sdkmanage CLI.

Yeah thats a lot of stuff to do. With GOUP on each machine you just run it. It works on all OS's apparently. Because its golang and self contains it "should" just work on all OS's. It will probably also work in GitHub CI I suspect, but have not tried yet.

Having multiple Java versions isn't a big deal, you can just reorder your PATH, or create one script for that. My recent issue was due to D8, which is now compiled by Java 11, ironically. Android SDK can be anything, and usually you should use the latest one.

The reason I thought it was good is not that, but because devs often already have a Android setup, and GOUP will be interfere with it all at or require the dev changing their shell settings.

For Windows build (which generates one MSIX) it's more complicated, it not only requires one Windows machine, but we also use a commercial software (Advanced Installer). The macOS also lacks the pkg/dmg installer.

Ah that interesting about Windows.
There is a golang package that makes the DMG for devs. I can add it here if you're curious. I used it and it worked well.

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

2 participants