diff --git a/bin/showGitVersion.dart b/bin/showGitVersion.dart index ed18c0e..53d203e 100644 --- a/bin/showGitVersion.dart +++ b/bin/showGitVersion.dart @@ -1,12 +1,11 @@ import 'dart:async'; import 'package:git_version/git_version.dart'; -import 'package:logging/logging.dart'; -import 'package:logging_handlers/logging_handlers_shared.dart'; +import 'package:console_log_handler/print_log_handler.dart'; Future main(List arguments) async { final Logger _logger = new Logger('git_version.main'); - _configLogging(defaultLogLevel: Level.WARNING); + configLogging(show: Level.WARNING); final removeDash = arguments.isNotEmpty && (arguments[0] == "--no-dash" || (arguments.length > 1 && arguments[1] == "--no-dash")); @@ -54,10 +53,3 @@ void _usage() { """.replaceAll(new RegExp(r'^[ ]*',multiLine: true), '')); } -void _configLogging({final Level defaultLogLevel = Level.INFO}) { - - hierarchicalLoggingEnabled = false; // set this to true - its part of Logging SDK - Logger.root.level = defaultLogLevel; - - Logger.root.onRecord.listen(new LogPrintHandler(messageFormat: "%t\t%n\t[%p]:\t%m")); -} diff --git a/build.jenkins b/build.jenkins index c8eaa71..b9ca8a9 100644 --- a/build.jenkins +++ b/build.jenkins @@ -16,11 +16,19 @@ pipeline { } } } + stage('Analyze') { + steps { + ansiColor('xterm') { + //echo "PATH is: $PATH" + sh 'grind analyze' + } + } + } stage('Test') { steps { ansiColor('xterm') { //echo "PATH is: $PATH" - sh 'grind test' + sh 'grind test-unit' } } } diff --git a/pubspec.yaml b/pubspec.yaml index 81ba6b9..d858c6c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: git_version description: Replaces the '%version%' placeholder with your current git version -version: 0.1.7 +version: 0.1.14 homepage: https://github.com/MikeMitterer/dart-git_version author: Mike Mitterer @@ -17,9 +17,9 @@ executables: dependencies: - logging: ^0.11.0 - logging_handlers: ^0.8.0 - console_log_handler: ^0.2.0 + logging: '>=0.11.3 <1.0.0' + console_log_handler: '>=0.5.0 <1.0.0' + # git: git@github.com:MikeMitterer/dart-console_log_handler.git # path: /Volumes/Daten/DevLocal/DevDart/ConsoleLogHandler barback: ^0.15.0 diff --git a/test/unit/config.dart b/test/unit/config.dart deleted file mode 100644 index 0463ffb..0000000 --- a/test/unit/config.dart +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at), - * IT-Consulting and Development Limited. - * - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -library get_version.unit.test.config; - -import 'dart:async'; - -import 'package:logging/logging.dart'; -import 'package:logging_handlers/logging_handlers_shared.dart'; - - -void configLogging({ final Level level: Level.OFF }) { - //hierarchicalLoggingEnabled = false; // set this to true - its part of Logging SDK - - // now control the logging. - // Turn off all logging first - Logger.root.level = level; - Logger.root.onRecord.listen(new LogPrintHandler()); -} - diff --git a/test/unit/git_version_test.dart b/test/unit/git_version_test.dart index 96017ac..08db403 100644 --- a/test/unit/git_version_test.dart +++ b/test/unit/git_version_test.dart @@ -17,14 +17,12 @@ * limitations under the License. */ -import 'package:logging/logging.dart'; +import 'package:console_log_handler/print_log_handler.dart'; import 'package:test/test.dart'; import 'package:git_version/git_version.dart'; -import 'config.dart'; - void main() { - configLogging(level: Level.WARNING); + configLogging(show: Level.WARNING); group('Git', () { setUp(() {}); diff --git a/tool/grind.dart b/tool/grind.dart index 7f3c66c..851a109 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -14,8 +14,11 @@ build() { clean() => defaultClean(); @Task() -@Depends(analyze) -test() { +@Depends(analyze,testUnit) +test() {} + +@Task() +testUnit() { //new TestRunner().testAsync(files: "test/unit"); new PubApp.local('test').run([]); // new TestRunner().testAsync(files: "test/integration");