library_version

This commit is contained in:
v7lin 2022-06-10 18:58:50 +08:00
parent cc474e8de3
commit ce75697482
3 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,12 @@
File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml')
String yaml = pubspec.text
// Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number.
java.util.regex.Matcher versionMatcher = java.util.regex.Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", java.util.regex.Pattern.MULTILINE).matcher(yaml)
versionMatcher.find()
String library_version = versionMatcher.group(1).replaceAll("\\+", "-")
group 'io.github.v7lin.weibo_kit'
version '4.0.0'
version library_version
buildscript {
repositories {

View File

@ -47,4 +47,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
COCOAPODS: 1.11.2
COCOAPODS: 1.11.3

View File

@ -2,9 +2,13 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint weibo_kit.podspec` to validate before publishing.
#
pubspec = YAML.load_file(File.join('..', 'pubspec.yaml'))
library_version = pubspec['version'].gsub('+', '-')
Pod::Spec.new do |s|
s.name = 'weibo_kit'
s.version = '4.0.0'
s.version = library_version
s.summary = 'A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.'
s.description = <<-DESC
A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.