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

Added support for configurable classpath file. #71

Merged
merged 2 commits into from
Jan 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# atom-maven package

[![Build Status](https://api.travis-ci.org/concon121/atom-maven.png)](https://api.travis-ci.org/concon121/atom-maven)
[![Dependency Status](https://david-dm.org/concon121/atom-maven.svg)](https://david-dm.org/concon121/atom-maven)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9b9b60c42152461a9ec4e29d84848b01)](https://www.codacy.com/app/connor-bray/atom-maven?utm_source=github.com&utm_medium=referral&utm_content=concon121/atom-maven&utm_campaign=Badge_Grade)
[![Code Climate](https://codeclimate.com/github/concon121/atom-maven/badges/gpa.svg)](https://codeclimate.com/github/concon121/atom-maven)
[![Issue Count](https://codeclimate.com/github/concon121/atom-maven/badges/issue_count.svg)](https://codeclimate.com/github/concon121/atom-maven)
Expand Down Expand Up @@ -34,13 +33,16 @@ Generates module specific .classpath files based on the Maven pom files in your
- The notification which informs you that a dependency doesn't exist always points to line 0.

## Configuration
Currently no configuration is required for this package. Please ensure that Apache Maven is correctly installed on your computer and is ready to use on the command line.
It is required that Apache Maven is correctly installed on your computer and is ready to use on the command line.

Please see the Maven website for [installation instructions](http://maven.apache.org/install.html).

## What's new in version 1.0.0
The atom-maven package is a lot lazier in the new release, relying on your Maven installation to do all the hard work, rather than trying to replicate everything that Maven does. In doing this, a lot of the features I wanted to implement I got for free.
| Configuration Key | Required / Optional | Description |
| :------: | :-----: | :-----: |
| classpathFileName | Optional | The name of the file to write your classpath to in your Maven module. |


## What's new?
Checkout the [changelog](https://github.com/concon121/atom-maven/blob/master/CHANGELOG.md) for the full list of recently implemented features and bug fixes.

## Backlog and Issues
Expand Down
17 changes: 14 additions & 3 deletions lib/atom-maven.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,21 @@ const INVALID_DEPENDENCY = 'Dependency could not be found in the local repositor

module.exports = {

cpConfigFileName: '.classpath',
config: {
classpathFileName: {
type: 'string',
default: '.classpath'
}
},

classpathFileName: atom.config.get('atom-maven.classpathFileName'),

activate: function () {
this.setup();
const self = this;
self.setup();
atom.config.observe('atom-maven.classpathFileName', {}, () => {
self.classpathFileName = atom.config.get('atom-maven.classpathFileName');
});
},

setup: function () {
Expand Down Expand Up @@ -92,7 +103,7 @@ module.exports = {
},

getClasspath: function (pomPath) {
return pomPath.replace('pom.xml', '.classpath');
return pomPath.replace('pom.xml', this.classpathFileName);
},

getEffectivePom: function (pomPath) {
Expand Down