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 CLI distribution zip #298

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Conversation

egorikftp
Copy link
Member

@Goooler On top of your logic I added this logic to avoid java -jar call

Final zip located in distributions folder

Screenshot 2024-11-18 at 21 23 06

@egorikftp egorikftp force-pushed the feature/build-distrubution-cli branch from e0b1bc9 to c6023e2 Compare November 18, 2024 18:47
@egorikftp egorikftp changed the base branch from main to build-a-cli November 18, 2024 18:47
@egorikftp egorikftp force-pushed the feature/build-distrubution-cli branch from c6023e2 to 0a6b1d3 Compare November 18, 2024 19:04
@Goooler
Copy link
Member

Goooler commented Nov 19, 2024

binaryJar already makes this jar executable.

@egorikftp
Copy link
Member Author

binaryJar already makes this jar executable.

For me it's not working. Only with 'java -jar'.
Also tried on your cli tool, the same behavior

@Goooler
Copy link
Member

Goooler commented Nov 19, 2024

May have to mark it executable. chmod +x ...

@egorikftp
Copy link
Member Author

Also tried 😑
Then found in clikt documentation section about installDist

@Goooler
Copy link
Member

Goooler commented Nov 19, 2024

I'm fine with migrating to installDist, in that case there is no need to build a fat jar or r8 jar, just align with https://github.com/JakeWharton/diffuse did.

@egorikftp
Copy link
Member Author

egorikftp commented Nov 19, 2024

I don't know what's better.
With shadow jar all jars from lib folder merged into single one and then with r8 I decrease size from 43mb to 8mb

@egorikftp
Copy link
Member Author

@Goooler two options:

shadow + r8 = 8.5mb
Screenshot 2024-11-19 at 12 17 43

pure installDist = 47.2mb
Screenshot 2024-11-19 at 12 18 48

@vkatz
Copy link
Contributor

vkatz commented Nov 19, 2024

8mb looks better... and will be better for some cli tools (so you can locate jar and use it in pipeline takin less space)

@egorikftp egorikftp force-pushed the feature/build-distrubution-cli branch from 0a6b1d3 to c589ec9 Compare November 20, 2024 08:04
@egorikftp egorikftp merged commit eb77694 into build-a-cli Nov 20, 2024
3 checks passed
@egorikftp egorikftp deleted the feature/build-distrubution-cli branch November 20, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants