Skip to content

Commit

Permalink
Initial commit. Created gitignore and README
Browse files Browse the repository at this point in the history
  • Loading branch information
timols committed Jul 22, 2013
0 parents commit 15271f9
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Idea project settings
.idea/artifacts
.idea/copyright
.idea/dictionaries
.idea/libraries
.idea/scopes
.idea/.name
.idea/compiler.xml
.idea/jenkinsSettings.xml
.idea/misc.xml
.idea/modules.xml
.idea/uiDesigner.xml
.idea/workspace.xml
.idea/dataSources.ids
.idea/dataSources.xml
*.iml

clientapp/test-results.xml
atlassian-ide-plugin.xml

# Java stuff
target
logs
*.log
*.log.zip

.DS_Store
13 changes: 13 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2013 Timothy Olshansky

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Introduction

Seeder is a first step to implementing a similar library in java to ruby's [Seed Fu](https://github.com/mbleigh/seed-fu).

It is currently only bound to Guice for dependency injection and is ORM agnostic. You only need to define a series of steps
to seed the database using java as opposed to sql. This is a perfect opportunity to use libraries like [Faker](https://github.com/DiUS/java-faker).

## Getting Started

1. Add your maven plugin dependency
```xml
<build>
...
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.timols</groupId>
<artifactId>seeder</artifactId>
<version>0.1.0</version>
</plugin>
</plugins>
</pluginManagement>
...
<plugins>
<plugin>
<artifactId>seeder</artifactId>
<configuration>
<stepsPackage>YOUR STEPS PACKAGE, e.g. com.myapp.steps</stepsPackage>
</configuration>
</plugin>
</plugins>
</build>
```

2. Define a module that in `YOUR STEPS PACKAGE` that sets up all of your Guice bindings
3. In the same package as the module, create classes that implement the `SeedStep` interface and do your actual work
4. Annotate your step classes with the `@Step(number = "STEP NUMBER")` annotation to define the order in which the steps should run.
4a. It may be helpful to name your classes either entirely or with the prefix `StepN` where N is the step number. This isn't necessary but makes it easier to keep track of order using filenames.
5. Run `mvn seeder:seed` from the root fo the project to perform the steps

You can see an example implementation [here](src/test/java/com/example).

## Contributing

* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the version, or history. If you want to have your own version, or is otherwise necessary, that is fine,
but please isolate to its own commit so I can cherry-pick around it.

## Copyright

Copyright (c) 2013 Tim Olshansky. See LICENSE for further details.

0 comments on commit 15271f9

Please sign in to comment.