3 ms·
I understand that you mastered producing a single binary with your favorite build tool. In my experience if a language does not have an official way to build pr
by datadeft 3y ago
I understand that you mastered producing a single binary with your favorite build tool. In my experience if a language does not have an official way to build projects it does end well. Go, Rust and Zig are the prime example that a language should not be separated from its build system.
How to produce a single binary:
go build
cargo build
zig build
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<exclude>classworlds:classworlds</exclude>
<exclude>junit:junit</exclude>
<exclude>jmock:*</exclude>
<exclude>*:xml-apis</exclude>
<exclude>org.apache.maven:lib:tests</exclude>
<exclude>log4j:log4j:jar:</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
Can you spot the difference?
- lenkite 3y agoI would like to point out that the language compiler in Rust (rustc) is certainly separated from its modular build system (cargo). Also, how so wonderfully and utterly balanced of you to give an old-school Maven pom.xml file with the maven-shade-plugin and exclusion lists, but omit the Cargo.toml and go.mod files. Also, its as simple in Java as: Gradlefile: apply plugin: 'java' command: gradle build Can you spot the difference ? EDIT: Ok you were asking about creating single all-in-one fatjar ? Add the below to your Gradlefile: Gradlefile: plugins { id 'com.github.johnrengelman.shadow' version '8.1.1' } apply plugin: 'com.github.johnrengelman.shadow' command: gradle shadowJar
- datadeft 3y ago> utterly balanced of you to give an old-school Maven pom.xml Sorry I started to use Java a long time ago, not sure what is the "recommended" way of doing things today. I guess I just need to know which random Github project is the new hotness today that does something that the other languages do out of the box. Thanks for supporting my point of view. Again, to produce a single binary you need to know/care much less with Zig, Go and Rust than with Java.
- kaba0 3y agoYes, one is a command line command, the other is a part of a build description file, so false equivalents.
- geodel 3y agoIs this a joke? Or you didn't really get the simple point that build description file is not mandatory or even required for other mentioned languages.
- kaba0 3y agoBut dependencies are somehow needed for Java (otherwise, what are you excluding? Log4j is not there by default)? How is that a fair comparison?