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

MANIFEST.MF seems refreshed when gradle build runs more than once #3

Open
hkurokawa opened this issue Nov 11, 2017 · 0 comments
Open

Comments

@hkurokawa
Copy link

hkurokawa commented Nov 11, 2017

When I run ./gradlew build command more than once, the MANIFEST.MF is refreshed and it looses build information. I had to fix it to remove .gradle directory.

It seems this behaviour might be related to generateBuildInfo task is skipped when it is up-to-date.

Environment

OS: Ubuntu 16.04.2 LTS (x86_64)

$ ./gradlew -v

------------------------------------------------------------
Gradle 2.11
------------------------------------------------------------

Build time:   2016-02-08 07:59:16 UTC
Build number: none
Revision:     584db1c7c90bdd1de1d1c4c51271c665bfcba978

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_131 (Oracle Corporation 25.131-b11)
OS:           Linux 4.4.0-97-generic amd64

Steps to reproduce

  1. Clone this repository
  2. Change the current directory to samples/example
  3. Run ./gradlew build && unzip -p build/libs/example.jar META-INF/MANIFEST.MF
  4. Run ./gradlew build && unzip -p build/libs/example.jar META-INF/MANIFEST.MF again
  5. Remove directory .gradle with rm -rf .gradle/*
  6. Run ./gradlew build && unzip -p build/libs/example.jar META-INF/MANIFEST.MF again

Result

At step 3, the build information was shown.

:compileJava
:processResources UP-TO-DATE
:generateBuildInfo
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 3.626 secs

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.11/userguide/gradle_daemon.html
Manifest-Version: 1.0
Git-Branch: master
Git-Commit: e1f11e6
Git-Committer-Date: 2016-12-20 00:05:55 +0900
Build-Date: 2017-11-11 12:20:58 +0900
Build-Java-Version: 1.8.0_131
Build-Java-Vendor: Oracle Corporation
Build-Os-Name: Linux
Build-Os-Version: 4.4.0-97-generic

However, at step 4, the information was lost.

:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:generateBuildInfo UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 2.958 secs

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.11/userguide/gradle_daemon.html
Manifest-Version: 1.0

And at step 5, the build information was back.

:compileJava
:processResources UP-TO-DATE
:generateBuildInfo
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 3.498 secs

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.11/userguide/gradle_daemon.html
Manifest-Version: 1.0
Git-Branch: master
Git-Commit: e1f11e6
Git-Committer-Date: 2016-12-20 00:05:55 +0900
Build-Date: 2017-11-11 12:33:37 +0900
Build-Java-Version: 1.8.0_131
Build-Java-Vendor: Oracle Corporation
Build-Os-Name: Linux
Build-Os-Version: 4.4.0-97-generic
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

1 participant