Skip to content

Commit e395ae6

Browse files
committed
updating readme and adding additional development details camel-tooling#31
Signed-off-by: Brian Fitzpatrick <[email protected]>
1 parent a636b6b commit e395ae6

File tree

2 files changed

+142
-8
lines changed

2 files changed

+142
-8
lines changed

README.md

+23-8
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ The generator is located in the npm repository (https://www.npmjs.com/package/ge
8080
-----------------------------------------------
8181
8282
? Your Camel project name (myproject)
83-
? Your Camel version 2.18.1
83+
? Your Camel version 2.22.2
8484
? DSL type (blueprint or spring) blueprint
8585
? Package name: com.myproject
8686
camel project name myproject
87-
camel version 2.18.1
87+
camel version 2.22.2
8888
camel DSL blueprint
8989
package name com.myproject
9090
Creating folders
@@ -99,7 +99,7 @@ Copying dot files
9999
### Notes on input fields
100100

101101
* 'Camel project name' defaults to the name of the directory in which you start the generator.
102-
* 'Camel version' defaults to 2.18.1 but if you provide a different version, that version then becomes the default for the next time the generator is run.
102+
* 'Camel version' defaults to 2.22.2 but if you provide a different version, that version then becomes the default for the next time the generator is run.
103103
* 'DSL type' defaults to 'spring' but if you change it to a valid DSL type such as 'blueprint', 'spring', or 'java', that becomes the default for the next time the generator is run. If you enter an invalid value, the generator will present an error ">> Camel DSL must be either 'spring', 'blueprint', or 'java'.".
104104
* 'Package name' defaults to 'com.' + the name of the directory (i.e. 'com.myproject'). This default does not change if you provide a different value.
105105

@@ -117,11 +117,29 @@ From the main generator-camel-project directory:
117117
> npm link
118118
```
119119

120+
### Running the generator with wsdl2rest
120121
Then create a directory you wish to create a Camel project in and run the generator as described above:
121122
```
122123
> yo camel-project
123124
```
124125

126+
To run the generator with the additional wsdl2rest functionality, now you simply type:
127+
```
128+
> yo camel-project --wsdl2rest
129+
```
130+
131+
This will prompt you for two additional properties:
132+
* wsdl? URL to the input WSDL (requires a file URL such as file:/E:/eclipse-photon/eclipse-workspace/empty-spring/src/main/resources/META-INF/wsdl/Address.wsdl)
133+
* outdirectory? Name of the output directory for generated artifacts src//main//java (this is defaulted to src/main/java and will be where the generated CXF source goes from the wsdl you specify)
134+
135+
### Running the generated projects
136+
137+
Generated templates for spring, blueprint, and Java DSLs can be run with:
138+
```
139+
> mvn install
140+
> mvn camel:run
141+
```
142+
125143
### Running the Mocha tests
126144
First you must install mocha with npm.
127145
```
@@ -132,14 +150,11 @@ Then, in the main generator-camel-project directory:
132150
> mocha
133151
```
134152

135-
## Known issues
153+
## Running the generated projects
136154

137-
Generated templates for spring and Java DSLs can be run with:
155+
Generated templates for spring, blueprint, and Java DSLs can be run with:
138156
```
139157
> mvn install
140158
> mvn camel:run
141159
```
142160

143-
Unfortunately, the blueprint version does not run successfully. Working on finding a solution.
144-
Created https://github.com/camel-tooling/generator-camel-project/issues/1
145-

developer-notes.md

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Yeoman Resources
2+
3+
## What is Yeoman?
4+
“...a generic scaffolding system allowing the creation of any kind of app. It allows for rapidly getting started on new projects and streamlines the maintenance of existing projects.”
5+
6+
* Provides an app-agnostic generator ecosystem that can be used to put together entire projects or just parts
7+
* Based in node.js using the npm package manager
8+
* Generators are available for Angular, Backbone, React, Polymer, and nearly 6,000 other projects
9+
10+
Common use cases for Yeoman generators include:
11+
12+
* Create a project
13+
* Create a new chunk of a project, like a unit test
14+
* Create a module or package
15+
* Bootstrap a new service
16+
* Enforce standards, best practices, and style guides in generated code
17+
* Gets users started quickly with sample apps
18+
19+
It’s very easy to install once you have NPM on a system:
20+
21+
* Install it: npm install -g yo (-g only works with admin privileges or via sudo if allowed)
22+
* Find your generator and install it: npm install -g generator-webapp (see above comment!)
23+
* And run it: yo webapp
24+
25+
## What are some basic Yeoman resources to get started?
26+
There are quite a few:
27+
28+
* Main Yeoman site: http://yeoman.io/
29+
* Writing your own Generator: http://yeoman.io/authoring/index.html
30+
* Good tutorial: https://scotch.io/tutorials/create-a-custom-yeoman-generator-in-4-easy-steps
31+
* IntelliJ Yeoman Plug-in: https://plugins.jetbrains.com/plugin/7987-yeoman
32+
* VSCode yo-code Generator: https://code.visualstudio.com/docs/extensions/yocode
33+
* Example from rsvalerio - Apache Camel + Spring Boot + Docker + Release plugin Yeoman Generator: https://github.com/rsvalerio/generator-camel
34+
35+
## Why should we care?
36+
Yeoman can integrate easily with many of the IDEs we currently want to support:
37+
38+
* VSCode (see https://code.visualstudio.com/docs/extensions/yocode )
39+
* IntelliJ (with a plug-in installed) - https://plugins.jetbrains.com/plugin/7987-yeoman
40+
* Eclipse Che
41+
42+
Depending on what we want to achieve regarding Fuse, we can quickly deliver yeoman generators to the http://yeoman.io/generators/ registry and have new functionality available to our users fast.
43+
44+
## What are we doing in Yeoman?
45+
In Spring 2018, we started playing with Yeoman locally as a quick win to generate a simple project in a cross-platform manner with little code. We demonstrated it at the F2F in Italy in June 2018 and continued work on the Camel Project generator from there.
46+
47+
A few notes about the generator:
48+
49+
* After installing the generator, create a new directory, change to the directory, and run: yo camel-project
50+
* You provide a name (it defaults to the folder name), a version (defaults to 2.18.2), your DSL type (spring, blueprint, or java - defaults to spring), and a package name (defaults to "com." + project name).
51+
* If all is well, it creates a simple project based on the DSL-flavored template you provided.
52+
* To build and run the project, type "mvn install" and "mvn camel:run".
53+
54+
### Running from command line without prompts
55+
With version 0.1.2 we have added command-line capabilities for providing argument values for the prompted information. Without prompting, this allows us to use the generator as part of a larger script to help prep a new project in a more automated fashion.
56+
57+
This allows us to do things like the following and avoid having to go through the prompts:
58+
```
59+
> yo camel-project appname=MyApp camelVersion=2.22.2 camelDSL=spring package=com.myapp
60+
```
61+
62+
## What are some important links for the Camel Project generator?
63+
64+
* Camel Project generator is available at: https://www.npmjs.com/package/generator-camel-project
65+
* Code is available at: https://github.com/camel-tooling/generator-camel-project
66+
* Current list of issues: https://github.com/camel-tooling/generator-camel-project/issues
67+
* Sonar - https://sonarcloud.io/dashboard?id=generator-camel-project
68+
* Travis - https://travis-ci.org/camel-tooling/generator-camel-project
69+
70+
## Development Notes
71+
72+
### Grabbing the code
73+
The code is available at github currently in: https://github.com/camel-tooling/generator-camel-project/
74+
75+
Fork the project and clone it locally. If you have suggestions or improvements, feel free to create
76+
pull requests and issues.
77+
78+
### Running the generator
79+
From the main generator-camel-project directory:
80+
```
81+
> npm link
82+
```
83+
84+
Then create a directory you wish to create a Camel project in and run the generator as described above:
85+
```
86+
> yo camel-project
87+
```
88+
89+
Read more [here](./README.md) for details on how to run the generator with all the bells and whistles.
90+
91+
### Running the Mocha tests
92+
First you must install mocha with npm.
93+
94+
```
95+
> npm install --global mocha
96+
```
97+
98+
Then, in the main generator-camel-project directory:
99+
```
100+
> mocha --timeout=5000
101+
```
102+
103+
Or you can run:
104+
```
105+
> npm test
106+
```
107+
108+
This fires up a mocha instance with the timeout set.
109+
110+
### Deploying to NPM
111+
Currently we've set up an automated system with Travis that uploads a new version to NPM when the following conditions are met:
112+
113+
* Version has been updated (https://github.com/camel-tooling/generator-camel-project/blob/master/package.json#L3)
114+
* A tag has been created (https://github.com/camel-tooling/generator-camel-project/tags)
115+
116+
When those conditions are met, the project is uploaded to the npm server and presented to our users.
117+
118+
The NPM account currently used is for Brian Fitzpatrick (https://www.npmjs.com/settings/bfitzpatrh/) and reuses a token generated there.
119+

0 commit comments

Comments
 (0)