Skip to content

Commit

Permalink
Add all of Maven build
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyer committed Oct 26, 2017
1 parent 5248532 commit b0bf148
Show file tree
Hide file tree
Showing 31 changed files with 9,300 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"apps": [
{
"root": "src",
"root": "client",
"outDir": "dist",
"assets": [
"assets",
Expand Down Expand Up @@ -36,11 +36,11 @@
},
"lint": [
{
"project": "src/tsconfig.app.json",
"project": "client/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"project": "client/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/out-tsc

# dependencies
/node
/node_modules

# IDEs and editors
Expand Down
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
131 changes: 117 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,130 @@
# Client
```
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<configuration>
<nodeVersion>v8.8.1</nodeVersion>
</configuration>
<executions>
<execution>
<id>install-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
```

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.4.9.
```
$ mvn generate-resources
$ cat > npm
#!/bin/sh
PATH="$PWD/node/":$PATH
node "node/node_modules/npm/bin/npm-cli.js" "$@"
$ chmod +x npm
$ ./npm install @angular/cli
```

## Development server
and run `mvn generate-resources` again.

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
```
$ cat > ng
#!/bin/sh
PATH="$PWD/node/":$PATH
node_modules/@angular/cli/bin/ng "$@"
$ chmod +x ng
$ ./ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
@angular/cli: 1.4.9
node: 8.8.1
os: linux x64
```

## Code scaffolding
No create an angular app:

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
```
$ ./ng new client
$ rm -rf client/node*
$ mv client/src tmp
$ mv client/* client/.??* .
$ rm -rf client
$ mv tmp client
$ sed -i -e 's,src,client,' .angular-cli.json
```

## Build
Add

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
```
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
```

## Running unit tests
Install the modules again using `mvn generate-resources`.

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
```
$ ./ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
@angular/cli: 1.4.9
node: 8.8.1
os: linux x64
@angular/animations: 4.4.6
@angular/common: 4.4.6
@angular/compiler: 4.4.6
@angular/core: 4.4.6
@angular/forms: 4.4.6
@angular/http: 4.4.6
@angular/platform-browser: 4.4.6
@angular/platform-browser-dynamic: 4.4.6
@angular/router: 4.4.6
@angular/cli: 1.4.9
@angular/compiler-cli: 4.4.6
@angular/language-service: 4.4.6
typescript: 2.3.4
```

## Running end-to-end tests
And the tests work:

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
```
$ ./ng e2e
...
[13:59:46] I/direct - Using ChromeDriver directly...
Jasmine started
## Further help
client App
✓ should display welcome message
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Executed 1 of 1 spec SUCCESS in 0.718 sec.
[13:59:48] I/launcher - 0 instance(s) of WebDriver still running
[13:59:48] I/launcher - chrome #01 passed
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit b0bf148

Please sign in to comment.