-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from OneSignal/beta-10
Add ability to configure version numbers, dedupe artifacts from `expo prebuild` - Beta 10 Release
- Loading branch information
Showing
14 changed files
with
143 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
## January 2022 | ||
|
||
### `1.0.0-beta10` - 01/24/2022 | ||
#### Added | ||
- ability to configure version numbers used in the NSE target's plist file. | ||
- `OneSignalLog` class for better console logging. | ||
- this changelog file. | ||
|
||
#### Fixed | ||
- re-running `expo prebuild` will no longer result in duplicate entitlements and dependencies added to native files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import * as fs from 'fs'; | ||
import { BUNDLE_SHORT_VERSION_TEMPLATE_REGEX, BUNDLE_VERSION_TEMPLATE_REGEX, GROUP_IDENTIFIER_TEMPLATE_REGEX } from './iosConstants'; | ||
import { OneSignalLog } from './OneSignalLog'; | ||
import { ReaderManager } from './ReaderManager'; | ||
|
||
const entitlementsFilePath =`${__dirname}/serviceExtensionFiles/OneSignalNotificationServiceExtension.entitlements`; | ||
const plistFilePath = `${__dirname}/serviceExtensionFiles/OneSignalNotificationServiceExtension-Info.plist`; | ||
|
||
const logIfError = (err: NodeJS.ErrnoException | null) => { | ||
if (err) { | ||
OneSignalLog.error("Error updating OneSignal NSE Entitlement File."); | ||
} | ||
} | ||
|
||
export default class NseUpdaterManager { | ||
static async updateNSEEntitlements(groupIdentifier: string) { | ||
let entitlementsFile = await ReaderManager.readFile(entitlementsFilePath); | ||
entitlementsFile = entitlementsFile.replace(GROUP_IDENTIFIER_TEMPLATE_REGEX, groupIdentifier); | ||
|
||
fs.writeFile(entitlementsFilePath, entitlementsFile, 'utf-8', (err) => { | ||
logIfError(err); | ||
}) | ||
} | ||
|
||
static async updateNSEBundleVersion(version: string) { | ||
let plistFile = await ReaderManager.readFile(plistFilePath); | ||
plistFile = plistFile.replace(BUNDLE_VERSION_TEMPLATE_REGEX, version); | ||
|
||
fs.writeFile(plistFilePath, plistFile, 'utf-8', err => { | ||
logIfError(err); | ||
}); | ||
} | ||
|
||
static async updateNSEBundleShortVersion(version: string) { | ||
let plistFile = await ReaderManager.readFile(plistFilePath); | ||
plistFile = plistFile.replace(BUNDLE_SHORT_VERSION_TEMPLATE_REGEX, version); | ||
|
||
fs.writeFile(plistFilePath, plistFile, 'utf-8', err => { | ||
logIfError(err); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export class OneSignalLog { | ||
static log(str: string) { | ||
console.log(`\tonesignal-expo-plugin: ${str}`) | ||
} | ||
|
||
static error(str: string) { | ||
console.error(`\tonesignal-expo-plugin: ${str}`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export const ONESIGNAL_GRADLE = | ||
`buildscript { | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
dependencies { | ||
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]' | ||
} | ||
} | ||
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters