Skip to content

Commit b86f3ec

Browse files
committed
fix: add kotlin to cli choices
1 parent dc1bfce commit b86f3ec

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

packages/cli/src/brownie/__tests__/commands/codegen.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ describe('runCodegen', () => {
113113
expect(mockGenerateSwift).not.toHaveBeenCalled();
114114
});
115115

116-
it('generates only swift by default even when kotlin is configured', async () => {
116+
it('generates swift and kotlin by default when kotlin is configured', async () => {
117117
tempDir = createTempPackageJson({
118118
brownie: {
119119
kotlin: './Generated',
@@ -124,7 +124,13 @@ describe('runCodegen', () => {
124124
await runCodegen({});
125125

126126
expect(mockGenerateSwift).toHaveBeenCalled();
127-
expect(mockGenerateKotlin).not.toHaveBeenCalled();
127+
expect(mockGenerateKotlin).toHaveBeenCalledWith({
128+
name: 'TestStore',
129+
schemaPath: '/path/to/TestStore.brownie.ts',
130+
typeName: 'TestStore',
131+
outputPath: 'Generated/TestStore.kt',
132+
packageName: undefined,
133+
});
128134
});
129135

130136
it('generates only specified platform', async () => {

packages/cli/src/brownie/commands/codegen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ export const codegenCommand = new Command('codegen')
142142
.addOption(
143143
new Option(
144144
'-p, --platform <platform>',
145-
'Generate for specific platform (swift)'
146-
).choices(['swift'])
145+
'Generate for specific platform (swift|kotlin)'
146+
).choices(['swift', 'kotlin'])
147147
)
148148
.action(
149149
actionRunner(async (options: RunCodegenOptions) => {

0 commit comments

Comments
 (0)