Skip to content

Commit

Permalink
Add version 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon Dudlik committed Apr 27, 2021
1 parent cec3d56 commit 9ec6ccd
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 93 deletions.
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
## [1.1.0]

### Changed

* Updated identifier documentation for replaced and new fonts.

### Fixed

* [iOS] Fixed compiler warnings.
* [Android] Fixed Android 11 ScopedStorage problems with `targetSdkVersion` 29.
* [Android] Fixed gradle hooks not working properly for Cordova Android 9.1+.

## [1.0.2]
- [Android] Fix `imglyConfig.gradle` overwrite issue.

### Fixed

* [Android] Fixed `imglyConfig.gradle` overwrite issue.

## [1.0.0]
* [iOS] Initial release of the Cordova plugin for VideoEditor SDK.
* [Android] Initial release of the Cordova plugin for VideoEditor SDK.

### Added

* Initial release of the Cordova plugin for VideoEditor SDK.
2 changes: 1 addition & 1 deletion hooks/dependencies-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = (context) => {
BLOCK_START +
`
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
classpath "ly.img.android.sdk:plugin:7.6.0"` +
classpath "ly.img.android.sdk:plugin:7.6.6"` +
"\n" +
BLOCK_END +
"\n";
Expand Down
92 changes: 43 additions & 49 deletions hooks/repositories-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,68 +11,62 @@ module.exports = (context) => {
"\n" +
BLOCK_START +
`
jcenter()
google()
gradlePluginPortal()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://artifactory.img.ly/artifactory/imgly" }` +
"\n" +
BLOCK_END +
"\n";

return new Promise((resolve, reject) => {
const platformRoot = path.join(
context.opts.projectRoot,
"platforms/android"
);
const platformRoot = path.join(
context.opts.projectRoot,
"platforms/android"
);

// const gradleFiles = findGradleFiles(platformRoot);
var gradleFiles = [path.join(platformRoot, "build.gradle")];
// const gradleFiles = findGradleFiles(platformRoot);
// We need to check both locations since from cordova v.10.* a dedicated `repositories.gradle` file
// is generated.
const gradleFiles = [path.join(platformRoot, "build.gradle"), path.join(platformRoot, "repositories.gradle")];

async.each(
gradleFiles,
function (file, callback) {
let fileContents = fs.readFileSync(file, "utf8");
return gradleFiles.forEach((file) => {
// We need to check whether the file really exists,
// else it will throw an error for Cordova < v.10.0.0.
if (!fs.existsSync(file)) {
return;
}

let found = fileContents.indexOf(
'maven { url "https://artifactory.img.ly/artifactory/imgly" }'
);
let fileContents = fs.readFileSync(file, "utf8");
let found = fileContents.indexOf(
'maven { url "https://artifactory.img.ly/artifactory/imgly" }'
);

if (found === -1) {
// not found
let insertLocations = [];
const myRegexp = /\brepositories\s*{(.*)$/gm;
let match = myRegexp.exec(fileContents);
while (match != null) {
insertLocations.push(match.index + match[0].length);
match = null; // just modify the first `repositories` tag
}
if (found === -1) {
// The artifactory repository reference has NOT been found.
let insertLocations = [];

if (insertLocations.length > 0) {
insertLocations.reverse(); // process locations end -> beginning
// to preserve indices
insertLocations.forEach((location) => {
fileContents =
fileContents.substr(0, location) +
imglyRepositories +
fileContents.substr(location);
});
// The regex differs for the different gradle files.
const myRegexp = file == gradleFiles[0] ? /\brepositories\s*{(.*)$/gm : /\bext.repos\s=\s*{(.*)$/gm;
let match = myRegexp.exec(fileContents);
while (match != null) {
insertLocations.push(match.index + match[0].length);
match = null; // just modify the first `repositories` tag
}

fs.writeFileSync(file, fileContents, "utf8");
console.log("updated " + file + " to include imgly repositories ");
}
if (insertLocations.length > 0) {
insertLocations.reverse(); // process locations end -> beginning
// to preserve indices
insertLocations.forEach((location) => {
fileContents =
fileContents.substr(0, location) +
imglyRepositories +
fileContents.substr(location);
});

callback();
} else {
callback();
}
},
function (err) {
if (err) {
console.error("unable to update gradle files", err);
reject();
} else {
resolve();
}
fs.writeFileSync(file, fileContents, "utf8");
console.log("Updated " + file + " to include img.ly repositories.");
return;
}
);
};
});
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cordova-plugin-videoeditorsdk",
"title": "Cordova plugin for VideoEditor SDK",
"version": "1.0.2",
"version": "1.1.0",
"types": "./types/index.d.ts",
"cordova_name": "cordova-plugin-videoeditorsdk",
"description": "A Cordova plugin for VideoEditor SDK. Integrate the video editor into your own HTML5, iOS or Android app - in minutes!",
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-videoeditorsdk" version="1.0.2">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-videoeditorsdk" version="1.1.0">
<name>VideoEditorSDK</name>
<description>A Cordova plugin for VideoEditor SDK. Integrate the video editor into your own HTML5, iOS or Android app - in minutes!</description>
<license>MIT</license>
Expand Down Expand Up @@ -65,7 +65,7 @@
<source url="https://github.com/CocoaPods/Specs.git"/>
</config>
<pods use-frameworks="true">
<pod name="VideoEditorSDK" spec="~> 10.19"/>
<pod name="VideoEditorSDK" spec="~> 10.22"/>
</pods>
</podspec>
</platform>
Expand Down
4 changes: 1 addition & 3 deletions src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ imglyConfig {
}
}

def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "7.6.0"
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "7.6.6"

task checkVESDKVersion {
if (imglyConfig.convertToVersionNumber(imglyConfig.getVersion()) < imglyConfig.convertToVersionNumber(MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION)) {
Expand All @@ -47,8 +47,6 @@ android {
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 19)
targetSdkVersion safeExtGet('targetSdkVersion', 29)
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
Expand Down
14 changes: 2 additions & 12 deletions src/ios/VESDKPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef void (^CDV_VESDKWillPresentBlock)(
@property(strong, atomic, nullable)
PESDKMediaEditViewController *mediaEditViewController;

- (void)present:(CDVInvokedUrlCommand *)command;
- (void)present:(CDVInvokedUrlCommand *_Nonnull)command;
- (void)unlockWithLicense:(nonnull id)json;

extern const struct VESDK_IMGLY_Constants {
Expand All @@ -50,17 +50,7 @@ extern const struct VESDK_IMGLY_Constants {

@end

@interface NSDictionary (VESDK_IMGLY_Category)

- (nullable id)getValueForKeyPath:(nonnull NSString *)keyPath
default:(nullable id)defaultValue;
+ (nullable id)getValue:(nullable NSDictionary *)dictionary
valueForKeyPath:(nonnull NSString *)keyPath
default:(nullable id)defaultValue;

@end

@interface VESDKConvert
@interface VESDKConvert : NSObject

typedef NSURL VESDK_IMGLY_ExportURL;
typedef NSURL VESDK_IMGLY_ExportFileURL;
Expand Down
34 changes: 21 additions & 13 deletions src/ios/VESDKPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
#import <objc/message.h>
@import VideoEditorSDK;

@interface NSDictionary (VESDK_IMGLY_Category)

- (nullable id)vesdk_getValueForKeyPath:(nonnull NSString *)keyPath
default:(nullable id)defaultValue;
+ (nullable id)vesdk_getValue:(nullable NSDictionary *)dictionary
valueForKeyPath:(nonnull NSString *)keyPath
default:(nullable id)defaultValue;

@end

@interface VESDKPlugin () <PESDKVideoEditViewControllerDelegate>
@property(strong) CDVInvokedUrlCommand *lastCommand;
@end
Expand Down Expand Up @@ -194,28 +204,28 @@ - (void)present:(CDVInvokedUrlCommand *)command {
};

// Set default values if necessary
id valueExportType = [NSDictionary getValue:withConfiguration
id valueExportType = [NSDictionary vesdk_getValue:withConfiguration
valueForKeyPath:@"export.type"
default:VESDK_IMGLY.kExportTypeFileURL];
id valueExportFile = [NSDictionary
getValue:withConfiguration
vesdk_getValue:withConfiguration
valueForKeyPath:@"export.filename"
default:[NSString stringWithFormat:@"imgly-export/%@",
[[NSUUID UUID] UUIDString]]];
id valueSerializationEnabled =
[NSDictionary getValue:withConfiguration
[NSDictionary vesdk_getValue:withConfiguration
valueForKeyPath:@"export.serialization.enabled"
default:@(NO)];
id valueSerializationType =
[NSDictionary getValue:withConfiguration
[NSDictionary vesdk_getValue:withConfiguration
valueForKeyPath:@"export.serialization.exportType"
default:VESDK_IMGLY.kExportTypeFileURL];
id valueSerializationFile =
[NSDictionary getValue:withConfiguration
[NSDictionary vesdk_getValue:withConfiguration
valueForKeyPath:@"export.serialization.filename"
default:valueExportFile];
id valueSerializationEmbedImage =
[NSDictionary getValue:withConfiguration
[NSDictionary vesdk_getValue:withConfiguration
valueForKeyPath:@"export.serialization.embedSourceImage"
default:@(NO)];

Expand Down Expand Up @@ -247,7 +257,7 @@ - (void)present:(CDVInvokedUrlCommand *)command {
NSMutableDictionary *updatedDictionary =
[NSMutableDictionary dictionaryWithDictionary:withConfiguration];
NSMutableDictionary *exportDictionary = [NSMutableDictionary
dictionaryWithDictionary:[NSDictionary getValue:updatedDictionary
dictionaryWithDictionary:[NSDictionary vesdk_getValue:updatedDictionary
valueForKeyPath:@"export"
default:@{}]];
[exportDictionary setValue:exportFile.absoluteString
Expand Down Expand Up @@ -460,25 +470,23 @@ - (void)videoEditViewControllerDidFailToGenerateVideo:
@implementation NSDictionary (VESDK_IMGLY_Category)

//// start extract value from path
- (nullable id)getValueForKeyPath:(nullable NSDictionary *)dictionary
valueForKeyPath:(nonnull NSString *)keyPath
- (nullable id)vesdk_getValueForKeyPath:(nonnull NSString *)keyPath
default:(nullable id)defaultValue {
id value = [dictionary valueForKeyPath:keyPath];
id value = [self valueForKeyPath:keyPath];
if (value == nil || value == [NSNull null]) {
return defaultValue;
} else {
return value;
}
}

+ (nullable id)getValue:(nullable NSDictionary *)dictionary
+ (nullable id)vesdk_getValue:(nullable NSDictionary *)dictionary
valueForKeyPath:(nonnull NSString *)keyPath
default:(nullable id)defaultValue {
if (dictionary == nil) {
return defaultValue;
}
return [dictionary getValueForKeyPath:dictionary
valueForKeyPath:keyPath
return [dictionary vesdk_getValueForKeyPath:keyPath
default:defaultValue];
}
//// end extract value from path
Expand Down
32 changes: 23 additions & 9 deletions types/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,19 +496,33 @@ export interface Configuration {
* { identifier: "imgly_font_open_sans_bold" },
* { identifier: "imgly_font_aleo_bold" },
* { identifier: "imgly_font_amaticsc" },
* { identifier: "imgly_font_bernier_regular" },
* { identifier: "imgly_font_cheque_regular" },
* { identifier: "imgly_font_gagalin_regular" },
* { identifier: "imgly_font_hagin_caps_thin" },
* { identifier: "imgly_font_intro_inline" },
* { identifier: "imgly_font_archivo_black" },
* { identifier: "imgly_font_bungee_inline" },
* { identifier: "imgly_font_campton_bold" },
* { identifier: "imgly_font_carter_one" },
* { identifier: "imgly_font_codystar" },
* { identifier: "imgly_font_fira_sans_regular" },
* { identifier: "imgly_font_galano_grotesque_bold" },
* { identifier: "imgly_font_krona_one" },
* { identifier: "imgly_font_kumar_one_outline" },
* { identifier: "imgly_font_lobster" },
* { identifier: "imgly_font_nexa_script" },
* { identifier: "imgly_font_molle" },
* { identifier: "imgly_font_monoton" },
* { identifier: "imgly_font_nixie_one" },
* { identifier: "imgly_font_notable" },
* { identifier: "imgly_font_ostrich_sans_black" },
* { identifier: "imgly_font_ostrich_sans_bold" },
* { identifier: "imgly_font_panton_blackitalic_caps" },
* { identifier: "imgly_font_panton_lightitalic_caps" },
* { identifier: "imgly_font_perfograma" },
* { identifier: "imgly_font_oswald_semi_bold" },
* { identifier: "imgly_font_palanquin_dark_semi_bold" },
* { identifier: "imgly_font_permanent_marker" },
* { identifier: "imgly_font_poppins" },
* { identifier: "imgly_font_roboto_black_italic" },
* { identifier: "imgly_font_roboto_light_italic" },
* { identifier: "imgly_font_sancreek" },
* { identifier: "imgly_font_stint_ultra_expanded" },
* { identifier: "imgly_font_trash_hand" },
* { identifier: "imgly_font_vt323" },
* { identifier: "imgly_font_yeseva_one" },
* ]
*/
fonts?: (Font | ExistingItem)[];
Expand Down

0 comments on commit 9ec6ccd

Please sign in to comment.