-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Generate API code + bootstrap webserver + simplify launch #8
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.gradle | ||
.idea | ||
build | ||
.DS_Store |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
# Conduit | ||
## Getting Started | ||
|
||
### Docker | ||
Simply run | ||
``` | ||
docker run --rm -it dataline/conduit:$VERSION | ||
./tools/app/start.sh | ||
``` | ||
|
||
### Repo | ||
``` | ||
VERSION=$(cat .version) | ||
docker build . -t dataline/conduit:$VERSION | ||
docker run --rm -it dataline/conduit:$VERSION | ||
``` | ||
And go to [http://localhost:8080]() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,25 @@ | ||
plugins { | ||
id 'java' | ||
allprojects { | ||
group = "io.dataline.${rootProject.name}" | ||
version = rootProject.file('.version').text.trim() | ||
} | ||
|
||
group 'io.dataline' | ||
version = rootProject.file('.version').text.trim() | ||
// For java projects (might need to add some filtering once we have the UI) | ||
subprojects { | ||
apply plugin: 'java' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile group: 'com.google.guava', name: 'guava', version: '29.0-jre' | ||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2' | ||
} | ||
dependencies { | ||
implementation group: 'com.google.guava', name: 'guava', version: '29.0-jre' | ||
|
||
task fatjar(type: Jar) { | ||
manifest { | ||
attributes 'Main-Class': 'io.dataline.playground.HelloWorld' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this needed if we are importing it as testImplementation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not the same lib There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. late night double vision |
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2' | ||
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.4.6' | ||
} | ||
baseName "${rootProject.name}-fatjar" | ||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } | ||
with jar | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
plugins { | ||
id "org.openapi.generator" version "4.3.1" | ||
id "java-library" | ||
} | ||
|
||
def specFile = "$projectDir/src/main/openapi/conduit.yaml".toString() | ||
|
||
openApiGenerate { | ||
generatorName = "jaxrs-spec" | ||
inputSpec = specFile | ||
outputDir = "$buildDir/generated".toString() | ||
|
||
apiPackage = "io.dataline.conduit.api" | ||
invokerPackage = "io.dataline.conduit.api.invoker" | ||
modelPackage = "io.dataline.conduit.api.model" | ||
|
||
generateApiDocumentation = false | ||
|
||
configOptions = [ | ||
dateLibrary : "java8", | ||
generatePom : "false", | ||
interfaceOnly: "true" | ||
] | ||
} | ||
|
||
dependencies { | ||
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.2' | ||
|
||
implementation group: 'io.swagger', name: 'swagger-annotations', version: '1.6.2' | ||
|
||
implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2' | ||
implementation group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1.1' | ||
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final' | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDir "$buildDir/generated/src/gen/java" | ||
} | ||
resources { | ||
srcDir "$projectDir/src/main/openapi/" | ||
} | ||
} | ||
} | ||
|
||
compileJava.dependsOn tasks.openApiGenerate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason to use tar vs jar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to follow the gradle way of distributing. I ran into a lot of problem with the server piece when I tried to create a fatjar.