Quellcode durchsuchen

Merge pull request #477 from csmith/master

Add a 'provided' scope.
pull/479/head
Greg Holmes vor 7 Jahren
Ursprung
Commit
ea08604bca
2 geänderte Dateien mit 31 neuen und 3 gelöschten Zeilen
  1. 24
    0
      README.md
  2. 7
    3
      build.gradle

+ 24
- 0
README.md Datei anzeigen

@@ -0,0 +1,24 @@
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 Datei anzeigen

@@ -16,7 +16,11 @@ subprojects {
16 16
     }
17 17
 
18 18
     configurations {
19
-        bundle
19
+        provided
20
+
21
+        bundle {
22
+            extendsFrom provided
23
+        }
20 24
 
21 25
         compile {
22 26
             extendsFrom bundle
@@ -33,7 +37,7 @@ subprojects {
33 37
     }
34 38
 
35 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 42
         compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
39 43
         compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.4'
@@ -98,7 +102,7 @@ subprojects {
98 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 106
             exclude 'META-INF/**'
103 107
         }
104 108
     }

Laden…
Abbrechen
Speichern