-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add mutiny support #189
base: master
Are you sure you want to change the base?
Add mutiny support #189
Changes from 16 commits
54901cc
0c93937
6fafcbe
9d90949
647c80f
309f536
071c09f
75b2527
4e123d5
2cd1c19
34c507d
9730547
c86dfec
b0b31e6
3ca065d
3575d46
b886b1d
e098a10
bdd8041
24a9001
03b4d28
fa9cb0a
90a3fb9
dc01e0c
b231d26
aceac49
f9907d0
7a11188
9b85004
37612ce
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 | ||
---|---|---|---|---|
|
@@ -33,12 +33,13 @@ You can provide the following query parameters to customize the project | |||
- `vertxDependencies`: a comma separated list of artifactIds of the vert.x modules | ||||
- `packageName`: code package name, derived from `groupId` and `artifactId` by default | ||||
- `jdkVersion`: which version of the JDK to use, defaults to `1.8` | ||||
- `flavor`: `vert.x` or `mutiny` | ||||
|
||||
Full example: | ||||
|
||||
``` | ||||
curl -X GET \ | ||||
'http://start.vertx.io/starter.zip?artifactId=starter&buildTool=maven&groupId=io.vertx&language=java&vertxDependencies=&vertxVersion=4.1.1' \ | ||||
'http://start.vertx.io/starter.zip?artifactId=starter&buildTool=maven&groupId=io.vertx&language=java&vertxDependencies=&vertxVersion=4.1.1&flavor=vert.x' \ | ||||
-o starter.zip | ||||
``` | ||||
|
||||
|
@@ -51,6 +52,7 @@ artitfactId==starter \ | |||
language==java \ | ||||
buildTool==maven \ | ||||
vertxVersion==4.1.1 \ | ||||
flavor==vert.x \ | ||||
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.
Suggested change
Same here 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. removed in bdd8041 |
||||
vertxDependencies==vertx-web,vertx-web-client \ | ||||
-o starter.zip | ||||
``` | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,7 @@ public interface ProjectConstants { | |
String ARCHIVE_FORMAT = "archiveFormat"; | ||
String PACKAGE_NAME = "packageName"; | ||
String JDK_VERSION = "jdkVersion"; | ||
String FLAVOR = "flavor"; | ||
String MUTINY_FLAVOR = "mutiny"; | ||
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. I don't believe this is necessary. It can be stored as an enum value. 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. addressed in e098a10 |
||
String VERTX_FLAVOR = "vert.x"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package io.vertx.starter.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
|
||
import java.util.Objects; | ||
|
||
public class Dependency { | ||
private String groupId; | ||
private String artifactId; | ||
|
||
public String getGroupId() { | ||
return groupId; | ||
} | ||
|
||
public Dependency setGroupId(String groupId) { | ||
this.groupId = groupId; | ||
return this; | ||
} | ||
|
||
public String getArtifactId() { | ||
return artifactId; | ||
} | ||
|
||
public Dependency setArtifactId(String artifactId) { | ||
this.artifactId = artifactId; | ||
return this; | ||
} | ||
|
||
@JsonIgnore | ||
public boolean isVertxDependency() { | ||
return ProjectFlavor.VERTX.getGroupId().equals(groupId); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
Dependency that = (Dependency) o; | ||
return Objects.equals(groupId, that.groupId) && Objects.equals(artifactId, that.artifactId); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(groupId, artifactId); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Dependency{" + | ||
"groupId='" + groupId + '\'' + | ||
", artifactId='" + artifactId + '\'' + | ||
'}'; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.vertx.starter.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Locale; | ||
|
||
import static io.vertx.starter.config.ProjectConstants.MUTINY_FLAVOR; | ||
import static io.vertx.starter.config.ProjectConstants.VERTX_FLAVOR; | ||
|
||
public enum ProjectFlavor { | ||
@JsonProperty(VERTX_FLAVOR) | ||
VERTX(VERTX_FLAVOR, "io.vertx"), | ||
@JsonProperty(MUTINY_FLAVOR) | ||
MUTINY(MUTINY_FLAVOR, "io.smallrye.reactive"); | ||
|
||
private final String id; | ||
private final String groupId; | ||
|
||
ProjectFlavor(String id, String groupId) { | ||
this.id = id; | ||
this.groupId = groupId; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getGroupId() { | ||
return groupId; | ||
} | ||
|
||
public static ProjectFlavor fromId(String id) { | ||
switch (id.toLowerCase(Locale.ROOT)) { | ||
case MUTINY_FLAVOR: | ||
return MUTINY; | ||
case VERTX_FLAVOR: | ||
return VERTX; | ||
default: | ||
return null; | ||
} | ||
} | ||
} |
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.
Let's keep the default for simple examples
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.
removed in bdd8041