Skip to content

Fast livesync for images in app folder #1388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/definitions/platform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ interface IPlatformData {
configurationFilePath?: string;
relativeToFrameworkConfigurationFilePath: string;
mergeXmlConfig?: any[];
fastLivesyncFileExtensions: string[];
}

interface IPlatformsData {
Expand Down
3 changes: 2 additions & 1 deletion lib/services/android-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
configurationFileName: "AndroidManifest.xml",
configurationFilePath: path.join(projectRoot, "src", "main", "AndroidManifest.xml"),
relativeToFrameworkConfigurationFilePath: path.join("src", "main", "AndroidManifest.xml"),
mergeXmlConfig: [{ "nodename": "manifest", "attrname": "*" }, {"nodename": "application", "attrname": "*"}]
mergeXmlConfig: [{ "nodename": "manifest", "attrname": "*" }, {"nodename": "application", "attrname": "*"}],
fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"] // http://developer.android.com/guide/appendix/media-formats.html
};
}

Expand Down
3 changes: 2 additions & 1 deletion lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
configurationFileName: "Info.plist",
configurationFilePath: path.join(projectRoot, this.$projectData.projectName, this.$projectData.projectName+"-Info.plist"),
relativeToFrameworkConfigurationFilePath: path.join("__PROJECT_NAME__", "__PROJECT_NAME__-Info.plist"),
mergeXmlConfig: [{ "nodename": "plist", "attrname": "*" }, {"nodename": "dict", "attrname": "*"}]
mergeXmlConfig: [{ "nodename": "plist", "attrname": "*" }, {"nodename": "dict", "attrname": "*"}],
fastLivesyncFileExtensions: [".tiff", ".tif", ".jpg", "jpeg", "gif", ".png", ".bmp", ".BMPf", ".ico", ".cur", ".xbm"] // https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/services/usb-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer

let localProjectRootPath = platform.toLowerCase() === "ios" ? platformData.appDestinationDirectoryPath : null;

let fastLivesyncFileExtensions = [".css", ".xml"];
let fastLivesyncFileExtensions = [".css", ".xml"].concat(platformData.fastLivesyncFileExtensions);

let fastLiveSync = (filePath: string) => {
this.$dispatcher.dispatch(() => {
Expand Down
3 changes: 1 addition & 2 deletions test/platform-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ class PlatformData implements IPlatformData {
deviceBuildOutputPath = "";
validPackageNamesForDevice: string[] = [];
frameworkFilesExtensions = [".jar", ".dat"];
frameworkVersion = "";
appDestinationDirectoryPath = "";
appResourcesDestinationDirectoryPath = "";
relativeToFrameworkConfigurationFilePath = "";
fastLivesyncFileExtensions: string[] = [];
}

class ErrorsNoFailStub implements IErrors {
Expand Down
6 changes: 4 additions & 2 deletions test/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ export class PlatformsDataStub implements IPlatformsData {
deviceBuildOutputPath: "",
validPackageNamesForDevice: [],
frameworkFilesExtensions: [],
relativeToFrameworkConfigurationFilePath: ""
relativeToFrameworkConfigurationFilePath: "",
fastLivesyncFileExtensions: []
};
}

Expand All @@ -289,7 +290,8 @@ export class PlatformProjectServiceStub implements IPlatformProjectService {
validPackageNamesForDevice: [],
frameworkFilesExtensions: [],
appDestinationDirectoryPath: "",
relativeToFrameworkConfigurationFilePath: ""
relativeToFrameworkConfigurationFilePath: "",
fastLivesyncFileExtensions: []
};
}
getAppResourcesDestinationDirectoryPath(): IFuture<string>{
Expand Down