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

Dep dependency manager #109

Closed
ansarizafar opened this issue Sep 5, 2017 · 4 comments
Closed

Dep dependency manager #109

ansarizafar opened this issue Sep 5, 2017 · 4 comments
Assignees
Labels

Comments

@ansarizafar
Copy link

Thanks for developing the ultimate Go framework. Will aah support Dep (Go dependency management tool)?

@adelowo
Copy link
Contributor

adelowo commented Sep 5, 2017

I do not think aah has to officially support dep before you can make use of it..
screenshot from 2017-09-05 13-57-39

@jeevatkm jeevatkm self-assigned this Sep 5, 2017
@jeevatkm
Copy link
Member

jeevatkm commented Sep 5, 2017

@adelowo Thanks for your inputs.

@ansarizafar Thank you for your appreciation. I wish if you could do that in social channels, it would help aah.

aah plays well with any package management tool as described in docs https://docs.aahframework.org/versioning.html#package-management. I have tested it.

As @adelowo mentioned, yes aah officially does not lean on particular package management tool since its a aah user choice.

For example: using dep tool - github.com/golang/dep/cmd/dep

I have quickly created this test app with steps for you.

Creating testdep

aah new
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
           aah framework v0.8 -  https://aahframework.org
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
# Report improvements/bugs at https://github.com/go-aah/aah/issues #

Welcome to interactive way to create your aah application, press ^C to exit :)

Based on your inputs, aah CLI tool generates the aah application structure for you.

Enter your application import path: testdep

Choose your application type (web or api), default is 'web':

Choose your application Auth Scheme (form, basic), default is 'none':

Choose your session store (cookie or file), default is 'cookie':

Your aah web application was created successfully at '/Users/jeeva/go/src/testdep'
You shall run your application via the command: 'aah run --importpath testdep'

Go to https://docs.aahframework.org to learn more and customize your aah application.

Go to app base directory and run dep init

jeeva@mb-pro:~/go/src$ cd /Users/jeeva/go/src/testdep
jeeva@mb-pro:~/go/src/testdep$ dep init
  Locking in v0.5 (a6c0702) for transitive dep aahframework.org/log.v0
  Locking in v0.9 (14ed79c) for transitive dep aahframework.org/router.v0
  Using ^0.8.0 as constraint for direct dep aahframework.org/aah.v0
  Locking in v0.8 (1241499) for direct dep aahframework.org/aah.v0
  Locking in master (81e9090) for transitive dep golang.org/x/crypto
  Locking in v0.2 (b66ffe0) for transitive dep aahframework.org/valpar.v0
  Locking in v0.2.2 (3368d72) for transitive dep aahframework.org/aruntime.v0
  Locking in v0.6 (cf06313) for transitive dep aahframework.org/essentials.v0
  Locking in v0.10 (f9b651b) for transitive dep aahframework.org/ahttp.v0
  Locking in v0.7 (308ebec) for transitive dep aahframework.org/security.v0
  Locking in v0.3 (8558a9d) for transitive dep aahframework.org/i18n.v0
  Locking in v0.4.2 (5e0e808) for transitive dep aahframework.org/config.v0
  Locking in v0.4.4 (9f3b186) for transitive dep aahframework.org/forge.v0
  Locking in v0.6 (3817959) for transitive dep aahframework.org/view.v0
jeeva@mb-pro:~/go/src/testdep$ ll
total 12
-rw-r--r--  1 jeeva  staff   2.2K Sep  5 08:42 Gopkg.lock
-rw-r--r--  1 jeeva  staff   606B Sep  5 08:42 Gopkg.toml
-rw-rw-rw-  1 jeeva  staff   2.0K Sep  5 08:41 aah.project
drwxr-xr-x  4 jeeva  staff   136B Sep  5 08:41 app/
drwxr-xr-x  6 jeeva  staff   204B Sep  5 08:41 config/
drwxr-xr-x  3 jeeva  staff   102B Sep  5 08:41 i18n/
drwxr-xr-x  6 jeeva  staff   204B Sep  5 08:41 static/
drwxr-xr-x  4 jeeva  staff   136B Sep  5 08:42 vendor/
drwxr-xr-x  6 jeeva  staff   204B Sep  5 08:41 views/
jeeva@mb-pro:~/go/src/testdep$

Now vendor directory, Gopkg.lock and Gopkg.toml got created.

Congrats you have successfully vendorized your app 😄

Use aah CLI as usual. Once vendor directory is present in app base directory. aah uses all the dependencies from vendor directory; not from GOPATH.

PS: If you wanna cross check, you can feel free to delete this directory $GOPATH/src/aahframework.org/* except tools.v0 since its required for aah new command and run the application. It demonstrates the use of vendor directory.

Running testdep

jeeva@mb-pro:~/go/src/testdep$ aah run
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
           aah framework v0.8 -  https://aahframework.org
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
# Report improvements/bugs at https://github.com/go-aah/aah/issues #

2017-09-05 09:03:45.406 INFO  Loading aah project file: /Users/jeeva/go/src/testdep/aah.project
2017-09-05 09:03:45.406 INFO  Hot-Reload enabled for environment profile: dev
2017-09-05 09:03:45.406 INFO  Compile starts for 'testdep' [testdep]
2017-09-05 09:03:45.410 DEBUG Cleaning /Users/jeeva/go/src/testdep/app/aah.go
2017-09-05 09:03:45.410 DEBUG Cleaning build directory /Users/jeeva/go/src/testdep/build
2017-09-05 09:03:45.411 DEBUG Executing /usr/local/go/bin/go list -f {{.Imports}} testdep/app/...
2017-09-05 09:03:45.617 DEBUG Executing /usr/local/go/bin/go build -i -o /Users/jeeva/go/src/testdep/build/bin/testdep testdep/app
2017-09-05 09:03:47.528 INFO  Compile successful for 'testdep' [testdep]
2017-09-05 09:03:47.528 DEBUG Executing /Users/jeeva/go/src/testdep/build/bin/testdep
2017-09-05 09:03:47.543 INFO  aah framework v0.8, requires ≥ go1.8
2017-09-05 09:03:47.548 INFO  aah application initialized successfully
2017-09-05 09:03:47.548 INFO  App Name: testdep
2017-09-05 09:03:47.548 INFO  App Version: 0.0.1
2017-09-05 09:03:47.548 INFO  App Build Date: 2017-09-05T09:03:45-07:00
2017-09-05 09:03:47.548 INFO  App Profile: dev
2017-09-05 09:03:47.548 INFO  App TLS/SSL Enabled: false
2017-09-05 09:03:47.548 INFO  App Session Mode: stateless
2017-09-05 09:03:47.548 INFO  aah go server running on :8080
^C2017-09-05 09:04:02.447 WARN  Interrupt signal received
2017-09-05 09:04:02.448 INFO  'testdep' application stopped
jeeva@mb-pro:~/go/src/testdep$

Feel free to ask your doubts/questions in Gitter or Github.

@jeevatkm
Copy link
Member

jeevatkm commented Sep 7, 2017

@ansarizafar I hope above inputs helped you. please let me know.

@jeevatkm
Copy link
Member

jeevatkm commented Sep 8, 2017

@ansarizafar I hope it solved your need, I'm closing this issue.

Feel free to asked your questions here or in Gitter.

@jeevatkm jeevatkm closed this as completed Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants