Skip to content

Commit

Permalink
build : 0.22.3+1
Browse files Browse the repository at this point in the history
* fix versioning of osm_interface
* improve python script that run before publish to pub
  • Loading branch information
liodali committed Nov 14, 2021
1 parent 54c6e96 commit c69987e
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.22.3+1 : version versioning in osm_interface package
* improve prepare publish script to manage max version supported by osm_interface
## 0.22.3 :
* fix map listener not working after cancel or confirm advanced picker (#181)
## 0.22.2 :
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flutter_osm_plugin
![pub](https://img.shields.io/badge/pub-v0.22.3-orange)
![pub](https://img.shields.io/badge/pub-v0.22.3%2B1-orange)

## Platform Support
| Android | iOS | Web |
Expand Down Expand Up @@ -36,7 +36,7 @@
Add the following to your `pubspec.yaml` file:

dependencies:
flutter_osm_plugin: ^0.22.3
flutter_osm_plugin: ^0.22.3+1

### Migration to `0.16.0` (Android Only)
> if you are using this plugin before Flutter 2
Expand Down
33 changes: 30 additions & 3 deletions check_pubspec_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,50 @@ def get_version_osm_interface():
lines = pub.readlines()
version_line = lines[LINE_VERSION]
version = version_line.split(":")[-1]
return version.replace(" ", "")
version = version.replace(" ", "")
version = version.replace("\n", "")
return version


def get_max_version(version):
index_max = 3
range_max = 1
package_v = version
if("+" in version):
package_v = str(version).split("+")[0]
if "-" in version:
package_v = str(version).split("-")[0]

listInnerVersionNumbers = str(package_v).split(".")
x, y, z = [int(i) for i in listInnerVersionNumbers]
z += 1
if z > 99:
y += 1
z = 0
if y > 99:
z = 0
y = 0
x += 1
max_version = str(x) + "." + str(y) + "."+str(z)
return max_version


def change_dependencies_version(name, version, isLocal=False):
mVersion = get_max_version(version=version)
with open(FILE_PUBSEPEC_OSM, "r+") as pub:
pub.seek(0, 0)
lines = []
removeNext = False
for line in pub.readlines():
if(name in line):
lines.append(f" {name} ^{version}")
v = f"\">={version} <{mVersion}\"".strip()
lines.append(f" {name} {v}")
if(isLocal):
removeNext = True
else:
if(removeNext):
removeNext = False
lines.append("")
lines.append("\n")
else:
lines.append(line)

Expand Down
16 changes: 8 additions & 8 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ packages:
source: sdk
version: "0.0.0"
flutter_osm_interface:
dependency: transitive
dependency: "direct overridden"
description:
path: "../flutter_osm_interface"
relative: true
source: path
name: flutter_osm_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
flutter_osm_plugin:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.22.1"
name: flutter_osm_plugin
url: "https://pub.dartlang.org"
source: hosted
version: "0.22.3"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down
7 changes: 4 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_osm_plugin: #^0.21.0-rc.2
path: ../
flutter_osm_plugin: ^0.22.3
# path: ../
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3

dependency_overrides:
flutter_osm_interface: "0.1.5"
dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ packages:
path: flutter_osm_interface
relative: true
source: path
version: "0.1.3"
version: "0.1.5"
flutter_plugin_android_lifecycle:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_osm_plugin
description: openStreetMap plugin for flutter apps ( iOS available in alpha version,web is under-dev)
version: 0.22.3
version: 0.22.3+1

homepage: https://github.com/liodali/osm_flutter
environment:
Expand Down

0 comments on commit c69987e

Please sign in to comment.