forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds the ability to specify explicit fields in MANIFEST.MF in a jvm_b…
…inary target. - Added 'manifest_entries' to jvm_binary target - Added a query to see if the manifest is empty in Manifest - Support detecting the git workdir from a directory other than cwd - Allow setting of both a main entry point and a custom manifest file when invoking jar-tool - Special 'git' value for Implementation-Version pulls the current git commit id for the directory where the jvm_binary() target is defined. Testing Done: Updated tests. Modified the `hello/simple/BUILD` file ``` jvm_binary(name = 'simple', source = 'HelloWorld.java', - main = 'org.pantsbuild.example.hello.simple.HelloWorld', + #main = 'org.pantsbuild.example.hello.simple.HelloWorld', + manifest_entries = { + 'Main-Class' : 'org.pantsbuild.example.hello.simple.HelloWorld', + 'Foo' : 'foo', + 'Implementation-Version' : 'git', + } ) ``` Then ran `./pants binary examples/src/java/org/pantsbuild/example/hello/simple/` and inspected the MANIFEST.MF file: ``` Manifest-Version: 1.0 Implementation-Version: 748d4da Foo: foo Created-By: com.twitter.common.jar.tool.JarBuilder Main-Class: org.pantsbuild.example.hello.simple.HelloWorld ``` Bugs closed: 1402 Reviewed at https://rbcommons.com/s/twitter/r/2084/
- Loading branch information
1 parent
937907d
commit 40a4a5b
Showing
16 changed files
with
325 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
testprojects/src/java/org/pantsbuild/testproject/manifest/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
jvm_binary( | ||
source = 'Manifest.java', | ||
name = 'manifest', | ||
main = 'org.pantsbuild.testproject.manifest.Manifest', | ||
manifest_entries = { | ||
'Implementation-Version' : '1.2.3', | ||
} | ||
) |
11 changes: 11 additions & 0 deletions
11
testprojects/src/java/org/pantsbuild/testproject/manifest/Manifest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). | ||
// Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
package org.pantsbuild.testproject.manifest; | ||
|
||
public class Manifest { | ||
public static void main(String args[]) { | ||
System.out.println("Hello World! Version: " | ||
+ Package.getPackage("org.pantsbuild.testproject.manifest").getImplementationVersion()); | ||
} | ||
} |
Oops, something went wrong.