version changing fixes

Change-Id: Ibdd24398c965ece8f365750499ad33859f872138
diff --git a/tools/build/onos-change-version b/tools/build/onos-change-version
index a04454f..0222921 100755
--- a/tools/build/onos-change-version
+++ b/tools/build/onos-change-version
@@ -19,6 +19,7 @@
 mvn versions:set -DnewVersion=$NEW_VERSION versions:commit
 mvn -f lib/pom.xml versions:set -DnewVersion=$NEW_VERSION versions:commit
 sed -i "" -E "1,/<version>/s/<version>[^<]*</<version>$NEW_VERSION</g" pom.xml
+sed -i "" -E "1,/<version>/s/<version>[^<]*</<version>$NEW_VERSION</g" drivers/bti/pom.xml
 
 # Augment the version of the Java API pom files and the overview.html file.
 for pom in docs/internal.xml docs/external.xml; do
@@ -46,3 +47,4 @@
 
 # Version the BUCK artifacts
 sed -i "" -E "s/ONOS_VERSION.*/ONOS_VERSION = '$NEW_VERSION'/" onos.defs
+sed -i "" -E "s/ONOS_VERSION=.*/ONOS_VERSION='$NEW_VERSION'/" tools/build/onos-prepare-sonar
diff --git a/tools/build/onos-prepare-sonar b/tools/build/onos-prepare-sonar
index 0b10168..bb2592b 100755
--- a/tools/build/onos-prepare-sonar
+++ b/tools/build/onos-prepare-sonar
@@ -11,13 +11,16 @@
 from shutil import copy, copytree, rmtree
 from subprocess import call, check_call, check_output
 
+# FIXME pull the version from the Buck version file
+ONOS_VERSION='1.8.0-SNAPSHOT'
+
 # SonarQube property file name and template
 FILE_NAME = 'sonar-project.properties'
 ROOT_TEMPLATE = '''# Auto-generated properties file
 sonar.projectKey=%(key)s
 sonar.projectName=%(name)s
 sonar.projectVersion=%(version)s
- 
+
 #sonar.sources=src
 sonar.sourceEncoding=UTF-8
 sonar.java.target = 1.8
@@ -109,12 +112,11 @@
     rmtree('surefire-reports')
 
 # Write the sonar properties file
-# FIXME pull the version from the Buck version file
 with open(FILE_NAME, 'w') as out:
   out.write(ROOT_TEMPLATE % {
     'name': 'onos',
     'key': 'org.onosproject:onos',
-    'version': '1.8.0-SNAPSHOT',
+    'version': ONOS_VERSION,
     'jacoco': '%s/buck-out/gen/jacoco/jacoco.exec' % ONOS_ROOT,
     'modules': ','.join([splitTarget(t)[1] for t in targets])
   })
diff --git a/tools/build/onos-sonar-properties b/tools/build/onos-sonar-properties
deleted file mode 100755
index 07b46c6..0000000
--- a/tools/build/onos-sonar-properties
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-#
-# This script generates the Sonar project properties file from the Buck rules
-# To run sonar, run 'sonar-scanner' from $ONOS_ROOT
-#
-
-import os
-from subprocess import call, check_call, check_output
-
-# SonarQube property file name and template
-FILE_NAME = 'sonar-project.properties'
-ROOT_TEMPLATE = '''# Auto-generated properties file
-sonar.projectKey=%(key)s
-sonar.projectName=%(name)s
-sonar.projectVersion=%(version)s
- 
-sonar.sources=src
-sonar.sourceEncoding=UTF-8
-sonar.language=java
- 
-sonar.modules=%(modules)s
-
-'''
-
-# Change to $ONOS_ROOT
-ONOS_ROOT = os.environ[ 'ONOS_ROOT' ]
-if ONOS_ROOT:
-  os.chdir( ONOS_ROOT )
-
-# Final all onos_jar rules
-cmd = ['onos-buck', 'query', "kind('onos_jar', deps(//tools/package:onos-package))"]
-output = check_output( cmd )
-
-modules = {}
-for line in output.rstrip().split('\n'):
-  # Parse rule into path and name
-  path, name = line.split(':', 2)
-  path = path.replace('//', '', 1)
-  if path not in modules:
-    modules[path] = name
-  else:
-    print "Skipping %s" % line
-
-# Write the sonar properties file
-# FIXME pull the version from the Buck version file
-with open(FILE_NAME, 'w') as f:
-  f.write(ROOT_TEMPLATE % { 
-    'name': 'onos',
-    'key': 'org.onosproject:onos',
-    'version': '1.8.0-SNAPSHOT',
-    'modules': ','.join( modules.values() )
-  })
-  for path, name in modules.iteritems():
-    f.write('%s.sonar.projectBaseDir=%s\n' % ( name, path ))
-    ''' Extra options
-    module2.sonar.projectBaseDir=Module 2
-    module2.sonar.sources=sources
-    module2.sonar.projectName=Module #2
-    '''
diff --git a/tools/build/onos-validate-change-version.excludes b/tools/build/onos-validate-change-version.excludes
index de38b8a..249017c 100755
--- a/tools/build/onos-validate-change-version.excludes
+++ b/tools/build/onos-validate-change-version.excludes
@@ -28,4 +28,7 @@
 \./providers/snmp/
 \./providers/bmv2/
 \./drivers/bmv2/
-\./apps/kafka-integration/
\ No newline at end of file
+\./apps/kafka-integration/
+\./pom.xml.versionsBackup
+\./tools/build/buck-publish-api
+\./tools/build/buck-plugin/BUCK