Skip to content

Commit 7bd99b9

Browse files
authored
refactor(bob)!: remove AAR target support (callstack#463)
### Summary This removes the (non-working) support for `aar` targets. Originally, the `aar` support was added with #4 to support AndroidX. However, it's not needed anymore so we are removing the support. ### Test plan 1. Create a new library with `npx create-react-native-library` 2. Add `aar` to targets 3. run `yarn prepack` 4. Make sure an error is printed and the program stops.
1 parent ef37512 commit 7bd99b9

File tree

8 files changed

+1
-214
lines changed

8 files changed

+1
-214
lines changed

README.md

-19
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ This will ask you few questions about your project and generate a new project in
3939
- ES modules build for bundlers such as webpack
4040
- Flow definitions (copies .js files to .flow files)
4141
- TypeScript definitions (uses `tsc` to generate declaration files)
42-
- Android AAR files
4342

4443
If you created a project with `create-react-native-library`, `react-native-builder-bob` is **already pre-configured to build your project**. You don't need to configure it again.
4544

@@ -209,24 +208,6 @@ Example:
209208
["typescript", { "project": "tsconfig.build.json" }]
210209
```
211210

212-
##### `aar`
213-
214-
Enable assembling Android AAR files for a library for React Native modules including native code.
215-
216-
The following options are supported:
217-
218-
- `reverseJetify` (`boolean`): If your package is using [AndroidX](https://developer.android.com/jetpack/androidx), it's possible to convert the AAR with the `reverseJetify` option to use the [Android support Library](https://developer.android.com/topic/libraries/support-library) using the [`jetifier`](https://www.npmjs.com/package/jetifier) package. This is useful to publish packages for older projects which haven't migrated to AndroidX.
219-
220-
- `androidPath` (`string`): You can specify a custom path to the `android` directory if it's not in the default location (`android` in the root of your project).
221-
222-
- `androidBundleName`: By default, the generated `aar` file is named as `android.aar`. You can specify a custom name using this option.
223-
224-
Example:
225-
226-
```json
227-
["aar", { "reverseJetify": true }]
228-
```
229-
230211
### Commands
231212

232213
The `bob` CLI exposes the following commands:

packages/create-react-native-library/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
"validate-npm-package-name": "^4.0.0",
5454
"yargs": "^17.5.1"
5555
},
56-
"optionalDependencies": {
57-
"jetifier": "^2.0.0"
58-
},
5956
"devDependencies": {
6057
"@babel/cli": "^7.17.10",
6158
"@babel/core": "^7.18.5",

packages/react-native-builder-bob/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@
5656
"which": "^2.0.2",
5757
"yargs": "^17.5.1"
5858
},
59-
"optionalDependencies": {
60-
"jetifier": "^2.0.0"
61-
},
6259
"devDependencies": {
6360
"@babel/cli": "^7.17.10",
6461
"@types/babel__core": "^7.1.19",

packages/react-native-builder-bob/src/index.ts

-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { cosmiconfigSync } from 'cosmiconfig';
77
import isGitDirty from 'is-git-dirty';
88
import prompts, { type PromptObject } from './utils/prompts';
99
import * as logger from './utils/logger';
10-
import buildAAR from './targets/aar';
1110
import buildCommonJS from './targets/commonjs';
1211
import buildModule from './targets/module';
1312
import buildTypescript from './targets/typescript';
@@ -123,11 +122,6 @@ yargs
123122
value: 'typescript',
124123
selected: /\.tsx?$/.test(entryFile),
125124
},
126-
{
127-
title: 'aar - bundle android code to a binary',
128-
value: 'aar',
129-
selected: false,
130-
},
131125
],
132126
validate: (input: string) => Boolean(input.length),
133127
},
@@ -407,15 +401,6 @@ yargs
407401
report.info(`Building target ${kleur.blue(targetName)}`);
408402

409403
switch (targetName) {
410-
case 'aar':
411-
await buildAAR({
412-
root,
413-
source: path.resolve(root, source as string),
414-
output: path.resolve(root, output as string, 'aar'),
415-
options: targetOptions,
416-
report,
417-
});
418-
break;
419404
case 'commonjs':
420405
await buildCommonJS({
421406
root,

packages/react-native-builder-bob/src/targets/aar.ts

-122
This file was deleted.

packages/react-native-builder-bob/src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type Input = {
1313
report: Report;
1414
};
1515

16-
export type Target = 'aar' | 'commonjs' | 'module' | 'typescript';
16+
export type Target = 'commonjs' | 'module' | 'typescript';
1717

1818
export type Options = {
1919
source?: string;

packages/react-native-builder-bob/src/utils/jetifier.ts

-46
This file was deleted.

yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -4381,11 +4381,6 @@ jake@^10.8.5:
43814381
filelist "^1.0.1"
43824382
minimatch "^3.0.4"
43834383

4384-
jetifier@^2.0.0:
4385-
version "2.0.0"
4386-
resolved "https://registry.yarnpkg.com/jetifier/-/jetifier-2.0.0.tgz#699391367ca1fe7bc4da5f8bf691eb117758e4cb"
4387-
integrity sha512-J4Au9KuT74te+PCCCHKgAjyLlEa+2VyIAEPNCdE5aNkAJ6FAJcAqcdzEkSnzNksIa9NkGmC4tPiClk2e7tCJuQ==
4388-
43894384
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
43904385
version "4.0.0"
43914386
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"

0 commit comments

Comments
 (0)