-
-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a simple 'HelloWorld' java example. This can be quickly used to…
… demonstrate different issues in pants without the complexities of the `examples/src/java/com/pants/examples/hello/main` target that is used to demonstrate more features of pants, like bundling, resources, etc. Testing Done: ./pants run examples/src/java/com/pants/examples/hello/simple Ran ./build-support/bin/publish_docs.sh and looked at the first_tutorial page. Bugs closed: 1180, 1365 Reviewed at https://rbcommons.com/s/twitter/r/2028/
- Loading branch information
1 parent
c468085
commit 8a495cb
Showing
3 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
jvm_binary(name = 'simple', | ||
source = 'HelloWorld.java', | ||
main = 'com.pants.examples.hello.simple.HelloWorld', | ||
) | ||
|
17 changes: 17 additions & 0 deletions
17
examples/src/java/com/pants/examples/hello/simple/HelloWorld.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,17 @@ | ||
// Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). | ||
// Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
package com.pants.examples.hello.simple; | ||
|
||
/** | ||
* A simple example that is runnable from within pants: | ||
* | ||
* ./pants run examples/src/java/com/pants/examples/hello/simple | ||
* | ||
*/ | ||
public class HelloWorld { | ||
|
||
public static void main(String[] args) { | ||
System.out.println("Hello World!"); | ||
} | ||
} |
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