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

build: added building, packaging, and localization scripts and tools #744

Merged
merged 5 commits into from
Oct 28, 2023

Conversation

tomasklaen
Copy link
Owner

@tomasklaen tomasklaen commented Oct 26, 2023

Main feature here is the intl tool that allows people to quickly create or update localization files with simple:

tools/intl de

This will parse the codebase for localization strings, and compare it against de locale, removing unused, and assigning null to new strings.

We can also make it even easier for people by running:

tools/intl all

after every localization string change, which will update all existing locales so people can just browse through theirs and fill in nulls.

Main feature here is the `scripts/intl` tool that allows people to quickly create or update localization files with simple:

```
scripts/intl de
```

This will parse the code for localization strings, and compare it against `de` locale, removing unused, and assigning `null` to new strings.

We can also make it even easier for people by running:

```
scripts/intl all
```

after every localization string change in the codebase, which will update all existing locales so people can just browse through their ones and fill in nulls.
@po5
Copy link
Contributor

po5 commented Oct 26, 2023

That's nice, but instead of having binaries in the git repo it'd better to attach them to a release.

@tomasklaen
Copy link
Owner Author

This is a development tool, it's not going to be in a release. It should be a script, but since this project isn't built around any runtime, we can't have a script file without requiring people to install some lua, python, or node. I wanted something people can just use with no setup barriers.

I look at it as a script that needs to be compiled :)

I'm not a fan of binaries in git either, but this seems to be the least friction solution.

@tomasklaen tomasklaen merged commit 656ddcf into main Oct 28, 2023
@Hrxn
Copy link

Hrxn commented Oct 28, 2023

Question regarding tools/package.ps1 is this intended to be run by GitHub Actions or some other CI/CD tools?

Because otherwise I don't get the point.

uosc/tools/package.ps1

Lines 33 to 38 in 55789e1

$compress = @{
LiteralPath = "dist/fonts", "dist/scripts"
CompressionLevel = "Optimal"
DestinationPath = "$ReleaseDir/uosc.zip"
}
Compress-Archive @compress

Is there another intermediate build step involved?

Maybe I'm just looking in the wrong place, but I don't see a dist/scripts directory in the repo?

And, as I understand it, the files in /dist are already automatically up-to-date builds made after changes have been made inside of /src, or do I get this wrong?

@tomasklaen
Copy link
Owner Author

tomasklaen commented Oct 28, 2023

No actions are set up atm. Packaging tool is for me to make the release zip used by command line installers and people installing manually.

Maybe I'm just looking in the wrong place, but I don't see a dist/scripts directory in the repo?

It's there.

And, as I understand it, the files in /dist are already automatically up-to-date builds made after changes have been made inside of /src, or do I get this wrong?

They are not generated, they are the sources. The way I look at it is src is for things that need to be built. dist is for things that don't, and lua files don't need to be built, so they sit in dist.

Soon there will be an intermediate built step to build some binaries that'll need to be included in the release zip. Their build destination will be in dist but they'll be gitignored.

I agree it's a bit of a mess, but we're juggling a lot of different environments (go, lua, mpv) and assets (fonts, soon binaries), and this seems to be the easiest to develop with. I just simlink stuff from dist to my mpv and that's it. No build step necessary during development. And packaging is also easy, you just zip what's in dist.

@Hrxn
Copy link

Hrxn commented Oct 28, 2023

Ah, yeah, dist/scripts/uosc must've missed that somehow.

They are not generated, they are the sources. The way I look at it is src is for things that need to be built. dist is for things that don't, and lua files don't need to be built, so they sit in dist.

Makes sense, good to know.
Also what I've been doing so far, simply taking the files fom /dist to "install" uosc.

@debugzxcv
Copy link

uosc/tools/build

Lines 45 to 47 in b8280b0

export GOARCH="amd64"
src="./src/ziggy/ziggy.go"
out_dir="./dist/scripts/uosc/bin"

tomasklaen added a commit that referenced this pull request Nov 1, 2023
@tomasklaen
Copy link
Owner Author

@debugzxcv 😐 thx for noticing.

@tomasklaen tomasklaen deleted the tools branch November 4, 2023 18:12
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.

4 participants