Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Update gradle build #1

Merged
merged 7 commits into from Nov 15, 2018
Merged

Conversation

devinbileck
Copy link
Member

Resolves concerns discussed in bisq-network/bisq#1901 (comment)

  • Update build.gradle to ensure reproducible builds
  • Generate MD5 hash file and print it during gradle build
  • Update source/target compatibility to 1.10

Copy link
Member

@cbeams cbeams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK, per comments.

build.gradle Outdated
@@ -1,10 +1,20 @@
apply plugin: 'groovy'
apply plugin: 'java'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't necessary.

Suggested change
apply plugin: 'java'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you're right. That's what I get for following examples too closely. I will remove it.

build.gradle Outdated
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
sourceCompatibility = '1.10'
targetCompatibility = '1.10'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to do this. We're not using 1.10 syntax, and furthermore this plugin is Groovy-based, not Java based, so the whole thing is kind of irrelevant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intention was for consistency with https://github.com/bisq-network/bisq/blob/master/build.gradle#L19.
But good point, I hadn't considered it is completely irrelevant. Perhaps I should just remove it?


jar.doLast { task ->
ant.checksum file: task.archivePath
println "md5=" + file("build/libs/gradle-witness.jar.MD5").text.trim()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm producing a different checksum result locally than what you report at bisq-network/bisq#1901 in the commit comment on bisq-network/bisq@ee96822:

~/Work/bisq-network/gradle-witness[update-gradle-build]
$ git log -1 --oneline
a4a1b2d (HEAD -> update-gradle-build, devinbileck/update-gradle-build) Update source/target compatibility to 1.10

$ ./gradlew --version
------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------

Build time:   2018-09-19 18:10:15 UTC
Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

Kotlin DSL:   1.0-rc-6
Kotlin:       1.2.61
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          10.0.2 ("Oracle Corporation" 10.0.2+13)
OS:           Mac OS X 10.12.5 x86_64

$ ./gradlew clean build
> Task :compileGroovy
> Task :jar
md5=ae4796f320ef3200515183fa9d3f4759

BUILD SUCCESSFUL in 2s
4 actionable tasks: 4 executed

$ cat ./build/libs/gradle-witness.jar.MD5
ae4796f320ef3200515183fa9d3f4759

(your commit comment says you produce the md5 sum 237be11ebb7604afa5ff478ec33d1df5)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argg! I will investigate further.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is due to different line endings in the witness.properties file. If I change it to LF (vs CRLF) I get the same result as you. Shall I add a .gitattributes file to ensure consistent line endings and prevent issues like this in the future?

Copy link
Member

@cbeams cbeams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. I can confirm I now get the same md5 sum when building the jar locally. Thanks, @devinbileck.

@cbeams cbeams merged commit 44b0391 into bisq-network:master Nov 15, 2018
cbeams added a commit that referenced this pull request Nov 15, 2018
@devinbileck devinbileck deleted the update-gradle-build branch November 15, 2018 17:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants