Skip to content
This repository
Browse code

Fix warnings, only output first start messages with debugM, close win…

…32 console window after leksah exits (start it minimized) and bumb the version up to 0.12.0.2
  • Loading branch information...
commit f1978cf95a84f50a9f874ff94b4cacf467fb0068 1 parent 5df81a6
Hamish Mackenzie authored March 05, 2012
24  leksah.cabal
... ...
@@ -1,5 +1,5 @@
1 1
 name: leksah
2  
-version: 0.12.0.0
  2
+version: 0.12.0.2
3 3
 cabal-version: >=1.8
4 4
 build-type: Simple
5 5
 license: GPL
@@ -99,11 +99,6 @@ library
99 99
         build-depends: dyre >= 0.8.3 && <0.9
100 100
         cpp-options: -DLEKSAH_WITH_YI_DYRE
101 101
 
102  
-    if (impl(ghc >= 7.2))
103  
-       build-depends: process >= 1.1 && <1.2
104  
-    else
105  
-       build-depends: process-leksah >=1.0.1.3 && <1.1
106  
-
107 102
     hs-source-dirs: src
108 103
     extensions: CPP
109 104
 
@@ -114,15 +109,10 @@ library
114 109
                        parsec >=2.1.0.1 && <3.2, pretty >=1.0.1.0 && <1.2,
115 110
                        regex-tdfa ==1.1.*, regex-base ==0.93.*, utf8-string >=0.3.1.1 && <0.4, array >=0.2.0.0 && <0.5,
116 111
                        time >=0.1 && <1.5, ltk >= 0.12 && <0.13, binary-shared >= 0.8 && <0.9, deepseq >= 1.1.0.0 && <1.4,
117  
-                       hslogger >= 1.0.7 && <1.2, leksah-server >=0.12 && <0.13, network >= 2.2 && <3.0,
  112
+                       hslogger >= 1.0.7 && <1.2, leksah-server >=0.12.0.1 && <0.13, network >= 2.2 && <3.0,
118 113
                        ghc >=6.10.1 && <7.5, strict >= 0.3.2 && <0.4, enumerator >=0.4.14 && <0.5, text >= 0.11.1.5 && < 0.12,
119 114
                        gio >= 0.12.2 && < 0.13, transformers >=0.2.2.0 && <0.3
120 115
 
121  
-    if (impl(ghc >= 7.2))
122  
-       build-depends: process >= 1.1 && <1.2
123  
-    else
124  
-       build-depends: process-leksah >=1.0.1.3 && <1.1
125  
-
126 116
     exposed-modules:
127 117
         IDE.Leksah IDE.Completion IDE.ImportTool
128 118
         IDE.Find IDE.Session IDE.Command IDE.Keymap IDE.Utils.GUIUtils IDE.SymbolNavigation
@@ -171,12 +161,6 @@ Executable leksah
171 161
     if flag(yi) && flag(dyre)
172 162
         cpp-options: -DLEKSAH_WITH_DYRE
173 163
 
174  
-    if (impl(ghc >= 7.2))
175  
-       build-depends: process >= 1.1 && <1.2
176  
-    else
177  
-       build-depends: process-leksah >=1.0.1.3 && <1.1
178  
-
179  
-
180 164
     if impl(ghc < 7.0) && flag(yi)
181 165
         build-depends: yi >=0.6.1 && <0.7
182 166
 
@@ -192,12 +176,12 @@ Executable leksah
192 176
                        parsec >=2.1.0.1 && <3.2, pretty >=1.0.1.0 && <1.2,
193 177
                        regex-tdfa ==1.1.*, regex-base ==0.93.*, utf8-string >=0.3.1.1 && <0.4, array >=0.2.0.0 && <0.5,
194 178
                        time >=0.1 && <1.5, ltk >=0.12 && <0.13, binary-shared >= 0.8 && <0.9, deepseq >= 1.1.0.0 && <1.4,
195  
-                       hslogger >= 1.0.7 && <1.2, leksah-server >=0.12 && <0.13, network >= 2.2 && <3.0,
  179
+                       hslogger >= 1.0.7 && <1.2, leksah-server >=0.12.0.1 && <0.13, network >= 2.2 && <3.0,
196 180
                        ghc >=6.10.1 && <7.5, strict >= 0.3.2 && <0.4, enumerator >=0.4.14 && <0.5, text >= 0.11.1.5 && < 0.12,
197 181
                        gio >= 0.12.2 && < 0.13, transformers >=0.2.2.0 && <0.3
198 182
     else
199 183
         hs-source-dirs: main
200  
-        build-depends: leksah ==0.12.0.0, base >=4.0.0.0 && <= 5
  184
+        build-depends: leksah ==0.12.0.2, base >=4.0.0.0 && <= 5
201 185
 
202 186
     main-is: Main.hs
203 187
     buildable: True
7  src/IDE/Core/Types.hs
@@ -104,12 +104,7 @@ import Graphics.UI.Gtk.Gdk.Enums (Modifier(..))
104 104
 #endif
105 105
 import System.Time (ClockTime(..))
106 106
 import Distribution.Simple (Extension(..))
107  
-#ifdef MIN_VERSION_process_leksah
108  
-import IDE.System.Process (ProcessHandle(..))
109  
-#else
110  
-import System.Process (ProcessHandle(..))
111  
-#endif
112  
-import IDE.Utils.Tool (ToolState(..))
  107
+import IDE.Utils.Tool (ToolState(..), ProcessHandle)
113 108
 import Data.IORef (writeIORef, readIORef, IORef(..))
114 109
 import Numeric (showHex)
115 110
 import Control.Event
11  src/IDE/Debug.hs
@@ -76,15 +76,10 @@ import IDE.Metainfo.Provider (getActivePackageDescr)
76 76
 import Distribution.Text (display)
77 77
 import IDE.Pane.Log (appendLog)
78 78
 import Data.List (isSuffixOf)
79  
-#ifdef MIN_VERSION_process_leksah
80  
-import IDE.System.Process (interruptProcessGroup)
81  
-#else
82  
-import System.Process (interruptProcessGroupOf)
83  
-#endif
84 79
 import IDE.Utils.GUIUtils (getDebugToggled)
85 80
 import IDE.Package (debugStart, executeDebugCommand, tryDebug_, printBindResultFlag,
86 81
         breakOnErrorFlag, breakOnExceptionFlag, printEvldWithShowFlag)
87  
-import IDE.Utils.Tool (ToolOutput(..), toolProcess)
  82
+import IDE.Utils.Tool (ToolOutput(..), toolProcess, interruptProcessGroupOf)
88 83
 import IDE.Workspaces (packageTry_)
89 84
 import qualified Data.Enumerator as E
90 85
 import qualified Data.Enumerator.List as EL
@@ -185,11 +180,7 @@ debugStop :: IDEAction
185 180
 debugStop = do
186 181
     maybeDebug <- readIDE debugState
187 182
     liftIO $ case maybeDebug of
188  
-#ifdef MIN_VERSION_process_leksah
189  
-        Just (_, ghci) -> toolProcess ghci >>= interruptProcessGroup
190  
-#else
191 183
         Just (_, ghci) -> toolProcess ghci >>= interruptProcessGroupOf
192  
-#endif
193 184
         Nothing -> return ()
194 185
 
195 186
 debugContinue :: IDEAction
8  src/IDE/ImportTool.hs
@@ -53,7 +53,7 @@ import Distribution.PackageDescription.Parse
53 53
 import Distribution.Verbosity (normal)
54 54
 import IDE.Pane.PackageEditor (hasConfigs)
55 55
 import Distribution.Package
56  
-import Distribution.Version (VersionRange(..))
  56
+import Distribution.Version (anyVersion)
57 57
 import Distribution.PackageDescription
58 58
        (CondTree(..), condExecutables, condLibrary, packageDescription,
59 59
         buildDepends)
@@ -160,15 +160,15 @@ addPackage error = do
160 160
                     let flat = flattenPackageDescription gpd
161 161
                     liftIO $ writePackageDescription (ipdCabalFile $ idePackage)
162 162
                         flat { buildDepends =
163  
-                            Dependency (pkgName pack) AnyVersion : buildDepends flat}
  163
+                            Dependency (pkgName pack) anyVersion : buildDepends flat}
164 164
                     return True
165 165
 #endif
166 166
   where
167 167
     addDepToLib n Nothing = Nothing
168 168
     addDepToLib n (Just cn@CondNode{condTreeConstraints = deps}) =
169  
-        Just (cn{condTreeConstraints = (Dependency n AnyVersion) : deps})
  169
+        Just (cn{condTreeConstraints = (Dependency n anyVersion) : deps})
170 170
     addDepToExe n (str,cn@CondNode{condTreeConstraints = deps}) =
171  
-        (str,cn{condTreeConstraints = (Dependency n AnyVersion) : deps})
  171
+        (str,cn{condTreeConstraints = (Dependency n anyVersion) : deps})
172 172
 
173 173
 getScopeForActiveBuffer :: IDEM (Maybe (GenScope, GenScope))
174 174
 getScopeForActiveBuffer = do
29  src/IDE/Leksah.hs
@@ -61,15 +61,10 @@ import Network (withSocketsDo)
61 61
 import Control.Exception
62 62
 import System.Exit(exitFailure)
63 63
 import qualified IDE.StrippedPrefs as SP
64  
-import IDE.Utils.Tool (runTool,toolline)
65  
-#ifdef MIN_VERSION_process_leksah
66  
-import IDE.System.Process(waitForProcess)
67  
-#else
68  
-import System.Process(waitForProcess)
69  
-#endif
  64
+import IDE.Utils.Tool (runTool, toolline, waitForProcess)
70 65
 import System.Log
71 66
 import System.Log.Logger
72  
-       (getLevel, getRootLogger, warningM, updateGlobalLogger,
  67
+       (getLevel, getRootLogger, debugM, updateGlobalLogger,
73 68
         rootLoggerName, setLevel)
74 69
 import Data.List (stripPrefix)
75 70
 import System.Directory (doesFileExist)
@@ -77,7 +72,7 @@ import System.FilePath (dropExtension, splitExtension, (</>))
77 72
 import qualified Data.Enumerator as E
78 73
 import qualified Data.Enumerator.List as EL
79 74
 import Data.Enumerator (($$))
80  
-import Control.Monad (when, liftM)
  75
+import Control.Monad (when, unless, liftM)
81 76
 import Control.Monad.IO.Class (MonadIO(..))
82 77
 
83 78
 -- --------------------------------------------------------------------
@@ -143,9 +138,9 @@ realMain yiConfig = do
143 138
 
144 139
     (o,files)       <-  ideOpts args
145 140
     isFirstStart    <-  liftM not $ hasSavedConfigFile standardPreferencesFilename
146  
-    let sessions        =   filter (\x -> case x of
147  
-                                        SessionN _ -> True
148  
-                                        _         -> False) o
  141
+    let sessions      =   catMaybes $ map (\x -> case x of
  142
+                                        SessionN s -> Just s
  143
+                                        _          -> Nothing) o
149 144
 
150 145
     let sessionFPs    =   filter (\f -> snd (splitExtension f) == leksahSessionFileExtension) files
151 146
     let workspaceFPs  =   filter (\f -> snd (splitExtension f) == leksahWorkspaceFileExtension) files
@@ -163,10 +158,9 @@ realMain yiConfig = do
163 158
                             if exists
164 159
                                 then return (Just spath,Nothing)
165 160
                                 else return (Nothing,Just fp)
166  
-    let ssession =  if not (null sessions)
167  
-                                then  (head $ map (\ (SessionN x) -> x) sessions) ++
168  
-                                            leksahSessionFileExtension
169  
-                                else  if null sourceFPs
  161
+    let ssession =  case sessions of
  162
+                        (s:_) -> s ++ leksahSessionFileExtension
  163
+                        _     -> if null sourceFPs
170 164
                                         then standardSessionFilename
171 165
                                         else emptySessionFilename
172 166
 
@@ -434,7 +428,8 @@ firstBuild newPrefs = do
434 428
     setLeksahIcon dialog
435 429
     set dialog [
436 430
         windowTitle := "Leksah: Updating Metadata",
437  
-        windowWindowPosition := WinPosCenter]
  431
+        windowWindowPosition := WinPosCenter,
  432
+        windowDeletable := False]
438 433
     vb          <- dialogGetUpper dialog
439 434
     progressBar <- progressBarNew
440 435
     progressBarSetText progressBar "Please wait while Leksah collects information about Haskell packages on your system"
@@ -459,7 +454,7 @@ firstBuild newPrefs = do
459 454
             let str = toolline to
460 455
             case stripPrefix "update_toolbar " str of
461 456
                 Just rest -> postGUIAsync $ progressBarSetFraction pb (read rest)
462  
-                Nothing   -> liftIO $ warningM "leksah" str
  457
+                Nothing   -> liftIO $ debugM "leksah" str
463 458
 
464 459
 
465 460
 
2  src/IDE/Metainfo/Provider.hs
@@ -276,7 +276,7 @@ updatePackageInfo rebuild idePack continuation =
276 276
                         [] -> modPairsMb
277 277
                         hd:_ -> hd : modPairsMb
278 278
     let (modWith,modWithout) = partition (\(x,y) -> isJust y) modPairsMb'
279  
-    let modWithSources       = map (\(f,Just s) -> (f,s)) modWith
  279
+    let modWithSources       = map (\(f,s) -> (f,fromJust s)) modWith
280 280
     let modWithoutSources    = map fst $ modWithout
281 281
     -- Now see which modules have to be truely updated
282 282
     modToUpdate <- if rebuild
11  src/IDE/Package.hs
@@ -96,12 +96,7 @@ import qualified Data.Set as  Set (fromList)
96 96
 import qualified Data.Map as  Map (empty, fromList)
97 97
 import System.Exit (ExitCode(..))
98 98
 import Control.Applicative ((<$>))
99  
-#ifdef MIN_VERSION_process_leksah
100  
-import IDE.System.Process (getProcessExitCode, interruptProcessGroup)
101  
-#else
102  
-import System.Process (getProcessExitCode, interruptProcessGroupOf)
103  
-#endif
104  
-import IDE.Utils.Tool (executeGhciCommand)
  99
+import IDE.Utils.Tool (executeGhciCommand, getProcessExitCode, interruptProcessGroupOf)
105 100
 import qualified Data.Enumerator as E (run_, Iteratee(..), last)
106 101
 import qualified Data.Enumerator.List as EL (foldM, zip3, zip)
107 102
 import Data.Enumerator (($$))
@@ -436,11 +431,7 @@ interruptBuild :: IDEAction
436 431
 interruptBuild = do
437 432
     maybeProcess <- readIDE runningTool
438 433
     liftIO $ case maybeProcess of
439  
-#ifdef MIN_VERSION_process_leksah
440  
-        Just h -> interruptProcessGroup h
441  
-#else
442 434
         Just h -> interruptProcessGroupOf h
443  
-#endif
444 435
         _ -> return ()
445 436
 
446 437
 -- ---------------------------------------------------------------------
11  src/IDE/Pane/Grep.hs
@@ -30,7 +30,7 @@ import Data.Maybe
30 30
 import Data.Typeable
31 31
 import IDE.Core.State
32 32
 import IDE.BufferMode
33  
-import IDE.Utils.Tool (runTool, ToolOutput(..))
  33
+import IDE.Utils.Tool (runTool, ToolOutput(..), getProcessExitCode, interruptProcessGroupOf)
34 34
 import Control.Concurrent
35 35
        (forkOS, newEmptyMVar, isEmptyMVar, takeMVar, putMVar, MVar,
36 36
         forkIO)
@@ -43,11 +43,6 @@ import System.FilePath ((</>), dropFileName)
43 43
 import System.Exit (ExitCode(..))
44 44
 import IDE.Pane.Log (getLog)
45 45
 import Control.DeepSeq
46  
-#ifdef MIN_VERSION_process_leksah
47  
-import IDE.System.Process (getProcessExitCode, interruptProcessGroup)
48  
-#else
49  
-import System.Process (getProcessExitCode, interruptProcessGroupOf)
50  
-#endif
51 46
 import qualified Data.Enumerator as E
52 47
        (Step(..), run_, Iteratee(..), run)
53 48
 import qualified Data.Enumerator.List as EL
@@ -266,11 +261,7 @@ grepDirectories regexString caseSensitive dirs = do
266 261
                                 step <- EL.isolate (toInteger max) $$ setGrepResults dir
267 262
                                 case step of
268 263
                                     E.Continue _ -> do
269  
-#ifdef MIN_VERSION_process_leksah
270  
-                                        liftIO $ interruptProcessGroup pid
271  
-#else
272 264
                                         liftIO $ interruptProcessGroupOf pid
273  
-#endif
274 265
                                         liftIO $ postGUISync $ do
275 266
                                             nDir <- treeModelIterNChildren store Nothing
276 267
                                             liftIO $ treeStoreChange store [nDir-1] (\r -> r{ context = "(Stoped Searching)" })
6  src/IDE/Pane/Log.hs
@@ -39,11 +39,7 @@ import Control.Exception hiding (try)
39 39
 import IDE.ImportTool
40 40
        (addPackage, parseHiddenModule, addImport, parseNotInScope,
41 41
         resolveErrors)
42  
-#ifdef MIN_VERSION_process_leksah
43  
-import IDE.System.Process (runInteractiveProcess, ProcessHandle)
44  
-#else
45  
-import System.Process (runInteractiveProcess, ProcessHandle)
46  
-#endif
  42
+import IDE.Utils.Tool (runInteractiveProcess, ProcessHandle)
47 43
 import Graphics.UI.Gtk
48 44
        (textBufferSetText, textViewScrollToMark,
49 45
         textBufferGetIterAtLineOffset, textViewScrollMarkOnscreen,
2  src/IDE/Pane/PackageEditor.hs
@@ -680,7 +680,7 @@ packageDD packages fp modules numBuildInfos extras = NFD ([
680 680
                     $ paraDirection <<<- ParaDirection Vertical
681 681
                         $ emptyParams)
682 682
             (\a -> case (testedWith . pd) a of
683  
-                []          -> []--(GHC,AnyVersion)]
  683
+                []          -> []--(GHC,anyVersion)]
684 684
                 l           -> l)
685 685
             (\ a b -> b{pd = (pd b){testedWith = a}})
686 686
             testedWithEditor
6  src/IDE/Pane/Preferences.hs
@@ -130,11 +130,11 @@ instance RecoverablePane IDEPrefs PrefsState IDEM where
130 130
                     Nothing -> return ()
131 131
                     Just newPrefs -> do
132 132
                         lastAppliedPrefs    <- readIORef lastAppliedPrefsRef
133  
-                        mapM_ (\ (FDPP _ _ _ _ applyF) -> reflectIDE (applyF newPrefs lastAppliedPrefs) ideR ) flatPrefsDesc
  133
+                        mapM_ (\f -> reflectIDE (applicator f newPrefs lastAppliedPrefs) ideR) flatPrefsDesc
134 134
                         writeIORef lastAppliedPrefsRef newPrefs)
135 135
             restore `onClicked` (do
136 136
                 lastAppliedPrefs <- readIORef lastAppliedPrefsRef
137  
-                mapM_ (\ (FDPP _ _ _ _ applyF) -> reflectIDE (applyF prefs lastAppliedPrefs) ideR ) flatPrefsDesc
  137
+                mapM_ (\f -> reflectIDE (applicator f prefs lastAppliedPrefs) ideR) flatPrefsDesc
138 138
                 injb prefs
139 139
                 writeIORef lastAppliedPrefsRef prefs
140 140
                 markLabel nb (getTopWidget prefsPane) False
@@ -146,7 +146,7 @@ instance RecoverablePane IDEPrefs PrefsState IDEM where
146 146
                 case mbNewPrefs of
147 147
                     Nothing -> return ()
148 148
                     Just newPrefs -> do
149  
-                        mapM_ (\ (FDPP _ _ _ _ applyF) -> reflectIDE (applyF newPrefs lastAppliedPrefs) ideR ) flatPrefsDesc
  149
+                        mapM_ (\f -> reflectIDE (applicator f newPrefs lastAppliedPrefs) ideR ) flatPrefsDesc
150 150
                         fp   <- getConfigFilePathForSave standardPreferencesFilename
151 151
                         writePrefs fp newPrefs
152 152
                         fp2  <-  getConfigFilePathForSave strippedPreferencesFilename
6  src/IDE/Utils/GUIUtils.hs
@@ -40,11 +40,7 @@ module IDE.Utils.GUIUtils (
40 40
 ) where
41 41
 
42 42
 import Graphics.UI.Gtk
43  
-#ifdef MIN_VERSION_process_leksah
44  
-import IDE.System.Process
45  
-#else
46  
-import System.Process
47  
-#endif
  43
+import IDE.Utils.Tool (runProcess)
48 44
 import Data.Maybe (fromJust, isJust)
49 45
 import Control.Monad
50 46
 import IDE.Core.State
6  src/IDE/Utils/ServerConnection.hs
@@ -20,11 +20,7 @@ module IDE.Utils.ServerConnection (
20 20
 import IDE.Core.State
21 21
 import Network (connectTo,PortID(..))
22 22
 import Network.Socket (PortNumber(..))
23  
-#ifdef MIN_VERSION_process_leksah
24  
-import IDE.System.Process(runProcess)
25  
-#else
26  
-import System.Process(runProcess)
27  
-#endif
  23
+import IDE.Utils.Tool (runProcess)
28 24
 import GHC.Conc(threadDelay)
29 25
 import System.IO
30 26
 import Control.Exception (SomeException(..), catch)
3  win32/leksah.bat
@@ -23,4 +23,5 @@ set leksah_server_libexecdir=%~dp0bin
23 23
 
24 24
 leksah.exe
25 25
 
26  
-pause
  26
+if errorlevel 1 pause
  27
+if not errorlevel 0 pause
2  win32/leksah.nsi
@@ -109,7 +109,7 @@ Section "Start Menu Shortcuts"
109 109
   CreateShortCut "$SMPROGRAMS\Leksah\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
110 110
   CreateShortCut "$SMPROGRAMS\Leksah\Server.lnk" "$INSTDIR\leksah-server.bat" "" "$INSTDIR\leksah.ico" 0
111 111
   CreateShortCut "$SMPROGRAMS\Leksah\Rebuild Metadata.lnk" "$INSTDIR\leksah-rebuild-metadata.bat" "" "$INSTDIR\leksah.ico" 0
112  
-  CreateShortCut "$SMPROGRAMS\Leksah\Leksah.lnk" "$INSTDIR\leksah.bat" "" "$INSTDIR\leksah.ico" 0
  112
+  CreateShortCut "$SMPROGRAMS\Leksah\Leksah.lnk" "$INSTDIR\leksah.bat" "" "$INSTDIR\leksah.ico" 0 SW_SHOWMINIMIZED
113 113
   
114 114
 SectionEnd
115 115
 

0 notes on commit f1978cf

Please sign in to comment.
Something went wrong with that request. Please try again.