Skip to content

Commit

Permalink
Minor macOS generator related changes (#292)
Browse files Browse the repository at this point in the history
* [macos-init] Build on publish

* [generate-macos] Cleanup copy-paste leftover

* [generator-macos] Remove FB copyright notices

Equal to upstream iOS change facebook#27725

* [generator-macos] Name app product without `-macOS` suffix
  • Loading branch information
alloy authored Apr 2, 2020
1 parent e0666e2 commit 7a67a24
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 65 deletions.
4 changes: 2 additions & 2 deletions local-cli/generate-macos.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {
* @param {String} name name of the root JS module for this app
* @param {Object} options command line options container
*/
function generateWindows (projectDir, name, options) {
function generateMacOS (projectDir, name, options) {
if (!fs.existsSync(projectDir)) {
fs.mkdirSync(projectDir);
}
Expand All @@ -29,4 +29,4 @@ function generateWindows (projectDir, name, options) {
);
}

module.exports = generateWindows;
module.exports = generateMacOS;
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import <Cocoa/Cocoa.h>

@class RCTBridge;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "AppDelegate.h"

#import <React/RCTBridge.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import <Cocoa/Cocoa.h>

@interface ViewController : NSViewController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "ViewController.h"
#import "AppDelegate.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import <Cocoa/Cocoa.h>

int main(int argc, const char *argv[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = "<group>"; };
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native-macos/React/React.xcodeproj"; sourceTree = "<group>"; };
38C1417223BBE33000902604 /* HelloWorld-macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloWorld-macOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
38C1417223BBE33000902604 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
38C141D123BBE33000902604 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "HelloWorld-macOS/Info.plist"; sourceTree = "<absolute>"; };
38C1421523BBE5B500902604 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
38C1421723BBE65C00902604 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -690,7 +690,7 @@
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* HelloWorld.app */,
38C1417223BBE33000902604 /* HelloWorld-macOS.app */,
38C1417223BBE33000902604 /* HelloWorld.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -741,7 +741,7 @@
);
name = "HelloWorld-macOS";
productName = "Hello World";
productReference = 38C1417223BBE33000902604 /* HelloWorld-macOS.app */;
productReference = 38C1417223BBE33000902604 /* HelloWorld.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand All @@ -751,7 +751,7 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = Facebook;
ORGANIZATIONNAME = "";
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -1338,7 +1338,7 @@
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.HelloWorld.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = HelloWorld;
SDKROOT = macosx;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -1359,7 +1359,7 @@
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.HelloWorld.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = HelloWorld;
SDKROOT = macosx;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "AppDelegate.h"

#import <React/RCTBridge.h>
Expand Down
7 changes: 0 additions & 7 deletions local-cli/generator-macos/templates/macos/HelloWorld/main.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import <UIKit/UIKit.h>

#import "AppDelegate.h"
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-macos-init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build": "just-scripts build",
"clean": "just-scripts clean",
"lint": "just-scripts lint",
"lint:fix": "just-scripts lint:fix"
"lint:fix": "just-scripts lint:fix",
"prepublishOnly": "npm run build"
},
"bin": {
"react-native-macos-init": "./bin.js"
Expand Down

0 comments on commit 7a67a24

Please sign in to comment.