@@ -8,6 +8,10 @@ _Golang_ programs and manage their dependencies via _dep_ tool. The project
8
8
directory doesn't have to be in the standard ` $GOAPTH ` repository, therefore
9
9
you can locate your project repository anywhere on filesystem.
10
10
11
+ The plugin can deal with _ "proprietary vendors"_ - package imports which are not in public repositories
12
+ like [ GitHub] ( https://github.com ) , or [ Bitbucket] ( https://bitbucket.org ) , but are proprietary, e.g. repositories
13
+ behind a company firewall etc. (see [ Limitations] ( https://github.com/sw-samuraj/gradle-godep-plugin#limitations ) )
14
+
11
15
Plugin expects that _ go_ and _ dep_ commands are already installed on given system and that they are available on ` $PATH ` .
12
16
13
17
** Currently, only Unix systems are supported. Windows support can be added on demand.**
@@ -16,6 +20,7 @@ Plugin expects that _go_ and _dep_ commands are already installed on given syste
16
20
17
21
1 . [ Applying the plugin] ( https://github.com/sw-samuraj/gradle-godep-plugin#applying-the-plugin )
18
22
1 . [ Using the plugin] ( https://github.com/sw-samuraj/gradle-godep-plugin#using-the-plugin )
23
+ 1 . [ How to handle proprietary vendors] ( https://github.com/sw-samuraj/gradle-godep-plugin#how-to-handle-proprietary-vendors )
19
24
1 . [ Example] ( https://github.com/sw-samuraj/gradle-godep-plugin#example )
20
25
1 . [ License] ( https://github.com/sw-samuraj/gradle-godep-plugin#license )
21
26
@@ -25,7 +30,7 @@ Plugin expects that _go_ and _dep_ commands are already installed on given syste
25
30
26
31
``` groovy
27
32
plugins {
28
- id "cz.swsamuraj.godep" version "0.4.3 "
33
+ id "cz.swsamuraj.godep" version "0.4.4 "
29
34
}
30
35
```
31
36
### All Gradle versions (or local repository)
@@ -38,7 +43,7 @@ buildscript {
38
43
}
39
44
}
40
45
dependencies {
41
- classpath "gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.4.3 "
46
+ classpath "gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.4.4 "
42
47
}
43
48
}
44
49
@@ -141,7 +146,64 @@ godep {
141
146
142
147
## How to handle proprietary vendors
143
148
144
- TBD
149
+ Go tools currently don't support package imports which are not in public repositories,
150
+ such as [ GitHub] ( https://github.com ) , [ Bitbucket] ( https://bitbucket.org ) etc. Therefore if you have a proprietary
151
+ repository, e.g. behind a company firewall, you are on your own to solve all the dependency and build problems.
152
+ The ` gradle-godep-plugin ` took a specific approach, how to handle this situation:
153
+
154
+ 1 . Use ` dep ` tool for solving of public imports, which are stored in the ` vendor ` directory.
155
+ 1 . Clone proprietary imports via Gradle ` proprietaryVendors ` task to the ` vendor ` directory.
156
+
157
+ ### Configuration
158
+
159
+ Unfortunately, configuration of the proprietary package imports has to be done on two places:
160
+
161
+ * ** ` build.gradle ` ** defines a map of package imports and their versions. These packages are clonned
162
+ during execution of the ` proprietaryVendors ` task.
163
+ * ** ` Gopkg.toml ` ** defines the same package imports (without versions) as ` ignored ` , so they can be ignored
164
+ during execution of the ` dep ` task.
165
+ * Eventually, if the proprietary package imports contain transitive dependencies on packages in public
166
+ repositories, those have to be defined in the ` Gopkg.toml ` file as ` required ` .
167
+
168
+ Let's consider following example: we have a proprietary package ` my.company.repo/cool-project/shared-package `
169
+ which has a transitive dependency on the ` github.com/coreos/etcd/clientv3 ` package.
170
+
171
+ ** ` build.gradle ` :**
172
+
173
+ ``` groovy
174
+ godep {
175
+ // Map of import packages from non-public repositories.
176
+ // The item in the map has an import path as a key and a tag
177
+ // (or a branch) as a value.
178
+ proprietaryVendors = [
179
+ 'my.company.repo/cool-project/shared-package': 'v0.1.0'
180
+ ]
181
+ }
182
+ ```
183
+ ** ` Gopkg.toml ` :**
184
+
185
+ ``` toml
186
+ # Needs to be filled only in case of transitive dependencies, otherwise can be omitted.
187
+ required = [
188
+ " github.com/coreos/etcd/clientv3"
189
+ ]
190
+
191
+ # It's the same package as in godep.proprietaryVendors map, only without version.
192
+ ignored = [
193
+ " my.company.repo/cool-project/shared-package"
194
+ ]
195
+
196
+ ```
197
+
198
+ ### Limitations
199
+
200
+ Currently, cloning of the proprietary vendors have these limitations:
201
+
202
+ * Cloning is done via _ https_ only (e.g. ` git clone https://xxx ` ).
203
+ * Cloned repository has to be anonymously accessible.
204
+
205
+ _ SSL_ , or _ https_ authentication could be added later, based on demand
206
+ (please, fill an [ issue] ( https://github.com/sw-samuraj/gradle-godep-plugin/issues ) ).
145
207
146
208
## Example
147
209
0 commit comments