revel.github.io icon indicating copy to clipboard operation
revel.github.io copied to clipboard

Dbugging in intellij

Open notzippy opened this issue 8 years ago • 8 comments

Add to docs from revel/revel#1072

Just for other people with the same question.

Create your project, for this example i will be using canonical "revel new github.com/myaccount/my-app" "revel run github.com/myaccount/my-app" to generate tmp/main.go - this file is needed by intellij Shutdown the running server Create project in intellij from existing sources Create run configuration and in "Program arguments" add "-importPath github.com\myaccount\my-app -srcPath \src -runMode dev" Point "File" to \src\github.com\myaccount\my-app\app\tmp\main.go In "before launch" add "Run external tool". There: Program: \bin\revel.exe Paramerets: build github.com/myaccount/my-app This works for me on Windows 8

notzippy avatar Jul 22 '17 15:07 notzippy

HI @notzippy,

I'm using MAC, I have this configuration but it doesn't work. It seems like it's unable to found the 'dev' mode.

Here is the error: INFO 14:51:09 app revel.go:170: app.conf: No mode found: dev section=system

In my app.conf both modes are defined and configured (dev and prod), is it possible that I need to specify somehow within the IntelliJ run configuration the path to the config file?

almarto avatar Feb 19 '18 14:02 almarto

@almarto did u solve the problem? I also can't get it working.

I basically followed the instruction:

  1. I have create a project called platform -> revel new platform
  2. revel run platform
  3. Created an IntelliJ project from existing source (using GoLand)
  4. Created a run Configuration

screen shot 2018-02-27 at 09 33 44

  1. Added before launch external tool screen shot 2018-02-27 at 09 43 06

Output:

Users/eikebartels/go/bin/revel build platform
~
DEBUG~ revel! http://revel.github.io
 09:46:46  revel  server.go:27: RegisterServerEngine: Registered engine   ~
section=server name=go 
DEBUG 09:46:46  revel template_engine.go:45: Registered template engine loaded         section=template go=nil LOG15_ERROR="Normalized odd number of arguments by adding nil" 
build [import path] [target path] [run mode]

Build the Revel web application named by the given import path.
This allows it to be deployed and run on a machine that lacks a Go installation.

The run mode is used to select which set of app.conf configuration should
apply and may be used to determine logic in the application itself.

Run mode defaults to "dev".

WARNING: The target path will be completely deleted, if it already exists!

For example:

    revel build github.com/revel/examples/chat /tmp/chat

Process finished with exit code 0

Debug output

/private/var/folders/r6/wfjk122d2hv88767fbydx92h0000gn/T/___Debug -importPath platform -srcPath \src -runMode dev #gosetup
DEBUG 09:46:48  revel  server.go:27: RegisterServerEngine: Registered engine   section=server name=go 
DEBUG 09:46:48  revel template_engine.go:45: Registered template engine loaded         section=template go=nil LOG15_ERROR="Normalized odd number of arguments by adding nil" 
INFO  09:46:48    app  revel.go:170: app.conf: No mode found: dev              section=system 

Process finished with exit code 1

Any idea? I think if we gonna solve the problem it will also help other :)

lasseschmitt avatar Feb 27 '18 08:02 lasseschmitt

Hi @DrivEddy,

I'm sorry but not. I'm newly with go and I'm just using it because I wanted to learn how it works so I don't have too much time to expend looking for a solution to this problem. I don't even know if the problem is within the IntelliJ plugin or revel itself that's why I created the issue. If I have a clue about how to solve I'd create a PR but it's not the case.

If someone has a deeper knowledge of this and is able to fix it I am quite sure it will be useful to many others.

almarto avatar Feb 27 '18 10:02 almarto

usage: revel build [import path] [target path] [run mode]?
Where targe path Settings?

kwame998 avatar Apr 14 '18 07:04 kwame998

up

jasacloud avatar May 11 '18 09:05 jasacloud

Have you resolve this problem , i have the same problem when debug revel app with GoLand IDE

skyzhp avatar Oct 27 '18 15:10 skyzhp

same question while using Mac,waiting for solve.If anyone solve it ,please answer here,thanks.

minicoder1024 avatar Oct 28 '18 02:10 minicoder1024

for anyone who is still struggling with run setting on mac, you just need to change one of the setting and its all done.

in the argument of the external tool setting, its not just build <app_name> actually build --run-mode=dev <app_name> src/<app_name>/app/tmp

cstlex avatar Dec 13 '18 07:12 cstlex