1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 17:59:33 +02:00

attempt to update converter script

This commit is contained in:
Steven Huang 2016-02-05 05:08:53 -08:00
parent 94ceca550b
commit 7ddccffc12

View file

@ -25,11 +25,13 @@ ignored = [
"ChangeLog", "ChangeLog",
"VERSION", "VERSION",
"AndroidManifest.xml.pattern", "AndroidManifest.xml.pattern",
"scripts/" "scripts/",
"project.properties"
] ]
added = [ added = [
"docs/" "docs/",
"third-party/"
] ]
conversionMap = { conversionMap = {
@ -73,6 +75,7 @@ conversionMap = {
"src/org/geometerplus/android/fbreader/libraryService/PositionWithTimestamp.aidl" : "fBReaderJ/src/main/aidl/org/geometerplus/android/fbreader/libraryService/PositionWithTimestamp.aidl", "src/org/geometerplus/android/fbreader/libraryService/PositionWithTimestamp.aidl" : "fBReaderJ/src/main/aidl/org/geometerplus/android/fbreader/libraryService/PositionWithTimestamp.aidl",
"src/org/geometerplus/android/fbreader/network/BookDownloaderInterface.aidl" : "fBReaderJ/src/main/aidl/org/geometerplus/android/fbreader/network/BookDownloaderInterface.aidl", "src/org/geometerplus/android/fbreader/network/BookDownloaderInterface.aidl" : "fBReaderJ/src/main/aidl/org/geometerplus/android/fbreader/network/BookDownloaderInterface.aidl",
"fbreader/app/" : "fBReaderJ/",
#src/com/paragon/dictionary/fbreader/OpenDictionaryActivity.java ? fbreader/app/src/main/java/com/paragon/dictionary/fbreader/OpenDictionaryActivity.java #src/com/paragon/dictionary/fbreader/OpenDictionaryActivity.java ? fbreader/app/src/main/java/com/paragon/dictionary/fbreader/OpenDictionaryActivity.java
} }
@ -98,6 +101,7 @@ def convertToAndroidStudioPaths(line):
fullPath = a if b == "" else b fullPath = a if b == "" else b
splitPaths = fullPath.split('/') splitPaths = fullPath.split('/')
firstPath = splitPaths[0] + '/' if len(splitPaths) > 1 else splitPaths[0] firstPath = splitPaths[0] + '/' if len(splitPaths) > 1 else splitPaths[0]
firstAndSecondPath = firstPath + (splitPaths[1] + '/') if len(splitPaths) > 1 else ''
deleteLine = False deleteLine = False
converted = "" converted = ""
@ -110,6 +114,13 @@ def convertToAndroidStudioPaths(line):
print "OK: \'" + firstPath + "\' is in map as " + conversionMap[firstPath] print "OK: \'" + firstPath + "\' is in map as " + conversionMap[firstPath]
splitPaths[0] = conversionMap[firstPath][:-1] if len(splitPaths) > 1 else conversionMap[firstPath] splitPaths[0] = conversionMap[firstPath][:-1] if len(splitPaths) > 1 else conversionMap[firstPath]
converted = '/'.join(splitPaths) converted = '/'.join(splitPaths)
# purposeful directory renaming in upstream (preparing for gradle build system 2c1d5c53e254a) discovered at 2/5/2016
elif firstAndSecondPath in conversionMap:
print "OK: \'" + firstAndSecondPath + "\' is in map as " + conversionMap[firstAndSecondPath] + "(narrowing procedure)"
# throw away the extra element
splitPaths = splitPaths[1:]
splitPaths[0] = conversionMap[firstAndSecondPath][:-1]
converted = '/'.join(splitPaths)
else: else:
if firstPath in unmoved: if firstPath in unmoved:
converted = fullPath converted = fullPath