From 45d1b4bee3709b03ecabfeecd10f998b77f2477a Mon Sep 17 00:00:00 2001
From: lealife <lifephp@gmail.com>
Date: Fri, 18 Sep 2015 11:30:38 +0800
Subject: [PATCH] add cmd to gen routes.go, main.go

---
 .travis.yml     |  8 ++++++++
 app/cmd/main.go | 19 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 app/cmd/main.go

diff --git a/.travis.yml b/.travis.yml
index d78e7b1..99ae4ad 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,9 +16,17 @@ script:
 
   - go test github.com/leanote/leanote/app/tests
 
+  # gen tmp/main.go, routes/routes.go
+  - go run app/cmd/main.go
+  # build
   - go build -o leanote github.com/leanote/leanote/app/tmp
+  # run with port 9000
   - ./leanote -importPath=github.com/leanote/leanote -runMode=dev -port=9000 &
+  # test
   - wget http://localhost:9000
+  - wget http://localhost:9000/blog
+  - wget http://localhost:9000/login
+  - wget http://localhost:9000/demo
 
   # - revel build github.com/leanote/leanote tmp
   # OK
\ No newline at end of file
diff --git a/app/cmd/main.go b/app/cmd/main.go
new file mode 100644
index 0000000..7b9df89
--- /dev/null
+++ b/app/cmd/main.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+	"github.com/revel/revel"
+	"github.com/revel/cmd/harness"
+	"fmt"
+)
+
+func main() {
+	// go run main.go
+	// 生成routes.go, main.go
+	revel.Init("", "github.com/leanote/leanote", "")
+	_, err := harness.Build() // ok, err
+	if err != nil {
+		panic(err)
+	}
+	fmt.Println("Ok")
+//	panicOnError(reverr, "Failed to build")
+}
\ No newline at end of file