Skip to content

Commit 3ac6ee7

Browse files
committed
Add AGPL conditional flag
1 parent ef75da4 commit 3ac6ee7

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

exe/Main.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ import Ide.Plugin.Example2 as Example2
9292
import Ide.Plugin.GhcIde as GhcIde
9393
import Ide.Plugin.Floskell as Floskell
9494
import Ide.Plugin.Ormolu as Ormolu
95+
#if AGPL
9596
import Ide.Plugin.Brittany as Brittany
97+
#endif
9698
import Ide.Plugin.Pragmas as Pragmas
9799

98100

@@ -114,18 +116,20 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
114116
basePlugins =
115117
[
116118
-- applyRefactDescriptor "applyrefact"
117-
Brittany.descriptor "brittany"
118119
-- , haddockDescriptor "haddock"
119120
-- , hareDescriptor "hare"
120121
-- , hsimportDescriptor "hsimport"
121122
-- , liquidDescriptor "liquid"
122123
-- , packageDescriptor "package"
123-
, GhcIde.descriptor "ghcide"
124+
GhcIde.descriptor "ghcide"
124125
, Pragmas.descriptor "pragmas"
125126
, Floskell.descriptor "floskell"
126127
-- , genericDescriptor "generic"
127128
-- , ghcmodDescriptor "ghcmod"
128129
, Ormolu.descriptor "ormolu"
130+
#if AGPL
131+
, Brittany.descriptor "brittany"
132+
#endif
129133
]
130134
examplePlugins =
131135
[Example.descriptor "eg"
@@ -173,7 +177,6 @@ main = do
173177
options = def { LSP.executeCommandCommands = Just commandIds
174178
, LSP.completionTriggerCharacters = Just "."
175179
}
176-
177180
if argLSP then do
178181
t <- offsetTime
179182
hPutStrLn stderr "Starting (haskell-language-server)LSP server..."

haskell-language-server.cabal

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cabal-version: 1.12
1+
cabal-version: 2.2
22
category: Development
33
name: haskell-language-server
44
version: 0.1.0.0
@@ -16,6 +16,11 @@ extra-source-files:
1616
README.md
1717
ChangeLog.md
1818

19+
flag agpl
20+
Description: Enable AGPL dependencies
21+
Default: True
22+
Manual: False
23+
1924
flag pedantic
2025
Description: Enable -Werror
2126
Default: False
@@ -25,12 +30,17 @@ source-repository head
2530
type: git
2631
location: https://github.com/haskell/haskell-language-server
2732

33+
common agpl
34+
if flag(agpl)
35+
cpp-options:
36+
-DAGPL
37+
2838
library
39+
import: agpl
2940
exposed-modules:
3041
Ide.Cradle
3142
Ide.Logger
3243
Ide.Plugin
33-
Ide.Plugin.Brittany
3444
Ide.Plugin.Config
3545
Ide.Plugin.Example
3646
Ide.Plugin.Example2
@@ -49,7 +59,6 @@ library
4959
base >=4.7 && <5
5060
, aeson
5161
, binary
52-
, brittany
5362
, bytestring
5463
, Cabal
5564
, cabal-helper >= 1.0
@@ -79,6 +88,12 @@ library
7988
build-depends: Win32
8089
else
8190
build-depends: unix
91+
if flag(agpl)
92+
build-depends:
93+
brittany
94+
exposed-modules:
95+
Ide.Plugin.Brittany
96+
8297
if impl(ghc >= 8.6)
8398
build-depends: ormolu >= 0.0.3.1
8499

@@ -92,6 +107,7 @@ library
92107
default-language: Haskell2010
93108

94109
executable haskell-language-server
110+
import: agpl
95111
main-is: Main.hs
96112
hs-source-dirs:
97113
exe
@@ -152,6 +168,7 @@ executable haskell-language-server
152168
default-language: Haskell2010
153169

154170
executable haskell-language-server-wrapper
171+
import: agpl
155172
main-is: Wrapper.hs
156173
hs-source-dirs:
157174
exe
@@ -189,6 +206,7 @@ executable haskell-language-server-wrapper
189206

190207

191208
test-suite func-test
209+
import: agpl
192210
type: exitcode-stdio-1.0
193211
default-language: Haskell2010
194212
build-tool-depends: hspec-discover:hspec-discover
@@ -246,6 +264,7 @@ test-suite func-test
246264
-- Development.IDE.Test.Runfiles
247265

248266
library hls-test-utils
267+
import: agpl
249268
hs-source-dirs: test/utils
250269
exposed-modules: TestUtils
251270
build-depends: base

0 commit comments

Comments
 (0)