Browse Source

Merge pull request #477 from csmith/master

Add a 'provided' scope.
pull/479/head
Greg Holmes 8 years ago
parent
commit
ea08604bca
2 changed files with 31 additions and 3 deletions
  1. 24
    0
      README.md
  2. 7
    3
      build.gradle

+ 24
- 0
README.md View File

1
+DMDirc plugins
2
+================================================================================
3
+
4
+This repository contains plugins for [DMDirc](https://www.dmdirc.com/), a Java
5
+IRC client.
6
+
7
+Development information
8
+--------------------------------------------------------------------------------
9
+
10
+### Gradle configurations
11
+
12
+We have two custom configurations for use when defining plugin dependencies:
13
+
14
+The **bundle** configuration allows dependencies to be bundled together into
15
+the plugin's jar file. This should be used for dependencies required at runtime
16
+that are not included in the main DMDirc client, or accessed via other plugins.
17
+Most of a plugin's dependencies should end up in the bundle configuration.
18
+
19
+The **provided** configuration works like the Maven 'provided' scope. It
20
+defines dependencies required to compile and run the plugin that will be
21
+provided to it somehow externally. Anything in the provided configuration
22
+(including transitive dependencies) will *not* be bundled into the plugin jar.
23
+The provided configuration is used for the main DMDirc client, and should be
24
+used for any intra-plugin dependencies.

+ 7
- 3
build.gradle View File

16
     }
16
     }
17
 
17
 
18
     configurations {
18
     configurations {
19
-        bundle
19
+        provided
20
+
21
+        bundle {
22
+            extendsFrom provided
23
+        }
20
 
24
 
21
         compile {
25
         compile {
22
             extendsFrom bundle
26
             extendsFrom bundle
33
     }
37
     }
34
 
38
 
35
     dependencies {
39
     dependencies {
36
-        compile group: 'com.dmdirc', name: 'client', version: '+', changing: true
40
+        provided group: 'com.dmdirc', name: 'client', version: '+', changing: true
37
 
41
 
38
         compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
42
         compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
39
         compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.4'
43
         compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.4'
98
             into 'META-INF'
102
             into 'META-INF'
99
         }
103
         }
100
 
104
 
101
-        from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
105
+        from { configurations.bundle.minus(configurations.provided).collect { it.isDirectory() ? it : zipTree(it) } } {
102
             exclude 'META-INF/**'
106
             exclude 'META-INF/**'
103
         }
107
         }
104
     }
108
     }

Loading…
Cancel
Save