Skip to content

Commit 7a67a24

Browse files
authored
Minor macOS generator related changes (#292)
* [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
1 parent e0666e2 commit 7a67a24

File tree

11 files changed

+10
-65
lines changed

11 files changed

+10
-65
lines changed

local-cli/generate-macos.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414
* @param {String} name name of the root JS module for this app
1515
* @param {Object} options command line options container
1616
*/
17-
function generateWindows (projectDir, name, options) {
17+
function generateMacOS (projectDir, name, options) {
1818
if (!fs.existsSync(projectDir)) {
1919
fs.mkdirSync(projectDir);
2020
}
@@ -29,4 +29,4 @@ function generateWindows (projectDir, name, options) {
2929
);
3030
}
3131

32-
module.exports = generateWindows;
32+
module.exports = generateMacOS;

local-cli/generator-macos/templates/macos/HelloWorld-macOS/AppDelegate.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import <Cocoa/Cocoa.h>
92

103
@class RCTBridge;

local-cli/generator-macos/templates/macos/HelloWorld-macOS/AppDelegate.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import "AppDelegate.h"
92

103
#import <React/RCTBridge.h>

local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import <Cocoa/Cocoa.h>
92

103
@interface ViewController : NSViewController

local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import "ViewController.h"
92
#import "AppDelegate.h"
103

local-cli/generator-macos/templates/macos/HelloWorld-macOS/main.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import <Cocoa/Cocoa.h>
92

103
int main(int argc, const char *argv[]) {

local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@
437437
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = "<group>"; };
438438
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = "<group>"; };
439439
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native-macos/React/React.xcodeproj"; sourceTree = "<group>"; };
440-
38C1417223BBE33000902604 /* HelloWorld-macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloWorld-macOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
440+
38C1417223BBE33000902604 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
441441
38C141D123BBE33000902604 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "HelloWorld-macOS/Info.plist"; sourceTree = "<absolute>"; };
442442
38C1421523BBE5B500902604 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
443443
38C1421723BBE65C00902604 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -690,7 +690,7 @@
690690
isa = PBXGroup;
691691
children = (
692692
13B07F961A680F5B00A75B9A /* HelloWorld.app */,
693-
38C1417223BBE33000902604 /* HelloWorld-macOS.app */,
693+
38C1417223BBE33000902604 /* HelloWorld.app */,
694694
);
695695
name = Products;
696696
sourceTree = "<group>";
@@ -741,7 +741,7 @@
741741
);
742742
name = "HelloWorld-macOS";
743743
productName = "Hello World";
744-
productReference = 38C1417223BBE33000902604 /* HelloWorld-macOS.app */;
744+
productReference = 38C1417223BBE33000902604 /* HelloWorld.app */;
745745
productType = "com.apple.product-type.application";
746746
};
747747
/* End PBXNativeTarget section */
@@ -751,7 +751,7 @@
751751
isa = PBXProject;
752752
attributes = {
753753
LastUpgradeCheck = 0940;
754-
ORGANIZATIONNAME = Facebook;
754+
ORGANIZATIONNAME = "";
755755
};
756756
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */;
757757
compatibilityVersion = "Xcode 3.2";
@@ -1338,7 +1338,7 @@
13381338
"-lc++",
13391339
);
13401340
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.HelloWorld.$(PRODUCT_NAME:rfc1034identifier)";
1341-
PRODUCT_NAME = "$(TARGET_NAME)";
1341+
PRODUCT_NAME = HelloWorld;
13421342
SDKROOT = macosx;
13431343
TARGETED_DEVICE_FAMILY = 1;
13441344
VERSIONING_SYSTEM = "apple-generic";
@@ -1359,7 +1359,7 @@
13591359
"-lc++",
13601360
);
13611361
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.HelloWorld.$(PRODUCT_NAME:rfc1034identifier)";
1362-
PRODUCT_NAME = "$(TARGET_NAME)";
1362+
PRODUCT_NAME = HelloWorld;
13631363
SDKROOT = macosx;
13641364
TARGETED_DEVICE_FAMILY = 1;
13651365
VERSIONING_SYSTEM = "apple-generic";

local-cli/generator-macos/templates/macos/HelloWorld/AppDelegate.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import <React/RCTBridgeDelegate.h>
92
#import <UIKit/UIKit.h>
103

local-cli/generator-macos/templates/macos/HelloWorld/AppDelegate.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import "AppDelegate.h"
92

103
#import <React/RCTBridge.h>

local-cli/generator-macos/templates/macos/HelloWorld/main.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
#import <UIKit/UIKit.h>
92

103
#import "AppDelegate.h"

packages/react-native-macos-init/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build": "just-scripts build",
1111
"clean": "just-scripts clean",
1212
"lint": "just-scripts lint",
13-
"lint:fix": "just-scripts lint:fix"
13+
"lint:fix": "just-scripts lint:fix",
14+
"prepublishOnly": "npm run build"
1415
},
1516
"bin": {
1617
"react-native-macos-init": "./bin.js"

0 commit comments

Comments
 (0)