Skip to content

Commit

Permalink
Add target_directory linter setting
Browse files Browse the repository at this point in the history
This allows the user to specify where to put generated class files.
If unset, class files will be put in the same directory as their
source files.

Closes #1.
  • Loading branch information
jawshooah committed Jun 4, 2015
1 parent 0adc66a commit 0b45aaf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ You can also add whitespace between classpath entries for better readability:
:/path/to/project/libs/lib.jar
```

### `target_directory`

This setting tells `scalac` where to put generated class files. If unset, class
files will be put in the same directory as their source files.

For example:

```json
"scalac": {
"target_directory": "$PROJECT_PATH/target/scala-2.11/classes"
}
```

## Contributing
If you would like to contribute enhancements or fixes, please do the following:

Expand Down
8 changes: 7 additions & 1 deletion linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class Scalac(Linter):
defaults = {
'lint': '',
'classpath': '',
'classpath_filename': ''
'classpath_filename': '',
'target_directory': ''
}
inline_settings = ['classpath', 'classpath_filename']
inline_overrides = 'lint'
Expand Down Expand Up @@ -117,6 +118,11 @@ def cmd(self):
if classpath:
command += ['-classpath', classpath]

target_directory = settings.get('target_directory')

if target_directory:
command += ['-d', target_directory]

return command

@property
Expand Down

0 comments on commit 0b45aaf

Please sign in to comment.