Skip to content

Commit

Permalink
adding README file and changing the build.gradle to copy properties a…
Browse files Browse the repository at this point in the history
…nd the Excel test file
  • Loading branch information
palych-piter committed Jul 10, 2017
1 parent 069c80f commit 5bb96e9
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ gradlew.bat
/build/


# Avoid ignoring lib jar files (.jar files are usually ignored)
!/libs/*.jar


# Compiled source #
###################
*.com
Expand Down Expand Up @@ -49,6 +53,7 @@ gradlew.bat
*.sql
*.sqlite


# OS generated files #
######################
.DS_Store
Expand Down
17 changes: 17 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

How to clone and build the project from the GitHub

1. Create a folder we you want to handle the project and clone the
project from the GitHub by running
"git clone https://github.com/palych-piter/Excel2DB.git".
The Excel2Db subfolder should be created.

2. Run the "gradlew shadowJar" gradle command. You should have the
Gradle pre-installed.

3. All is set. The "build/libs/" subfolder should have the newest jar file
generated. By default the subfolder contains the property file pointing to
the Derby database as the testing implementation and test.xlsx
as the test Excel file.


21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
group 'excel2db'
version '2.0'


apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'


buildscript {
repositories {
jcenter()
Expand All @@ -13,6 +15,7 @@ buildscript {
}
}


sourceSets {
main {
java {
Expand Down Expand Up @@ -67,6 +70,7 @@ dependencies {

}


jar {

manifest {
Expand Down Expand Up @@ -94,6 +98,23 @@ jar {
exclude '**/PopulateTablePostgresImplTest.class'
}

//the copyFiles task executes right after the shadowJar and copy
//the property and test files into the build folder
task copyFiles {
doLast {
copy {
from 'src/main/resources/excel2db.properties'
into 'build/libs/'
}
copy {
from '/test.xlsx'
into 'build/libs/'
}
}
}

shadowJar.finalizedBy(copyFiles)

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void establishDBConnection() {

} catch (SQLException e) {
logger.error("Derby Connection Failed! Check output console");

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/excel2db.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
db.implementation=Derby

# names of input tables
input.files=test.xlsx,test1.xlsx
input.files=test.xlsx

# postgres connection parameters
db.server=localhost
Expand Down

0 comments on commit 5bb96e9

Please sign in to comment.