Skip to content
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

Dbugging in intellij #134

Open
notzippy opened this issue Jul 22, 2017 · 8 comments
Open

Dbugging in intellij #134

notzippy opened this issue Jul 22, 2017 · 8 comments

Comments

@notzippy
Copy link
Contributor

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

@almarto
Copy link

almarto commented Feb 19, 2018

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?

@lasseschmitt
Copy link

@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 :)

@almarto
Copy link

almarto commented Feb 27, 2018

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.

@kwame998
Copy link

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

@jasacloud
Copy link

up

@skyzhp
Copy link

skyzhp commented Oct 27, 2018

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

@minicoder1024
Copy link

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

@cstlex
Copy link

cstlex commented Dec 13, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants