Skip to content

Commit

Permalink
feat: native add command to add native source files to the project (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcassidyav authored Jul 3, 2024
1 parent 6509773 commit 2f2d1e0
Show file tree
Hide file tree
Showing 8 changed files with 592 additions and 1 deletion.
32 changes: 32 additions & 0 deletions docs/man_pages/project/configuration/native/native-add-java.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<% if (isJekyll) { %>---
title: ns native add java
position: 2
---<% } %>

# ns native add java

### Description

Adds a newly generated Java file, which includes a class with the specified name, placing it in the appropriate directory.

### Commands

Usage | Synopsis
------|-------
Java | `$ ns native add java <Java class name>`

### Arguments

* `<Java class name>` is the fully qualified name of the `Class` to create, e.g. `org.nativescript.SomeClass`

<% if(isHtml) { %>

### Related Commands

Command | Description
----------|----------
[native add swift](native-add-swift.html) | Generates and adds a Swift file containing a class of the given name.
[native add objective-c](native-add-objective-c.html) | Generates and adds Objective-C files containing an interface of the given name.
[native add java](native-add-java.html) | Generates and adds a Java file containing a class of the given name.
[native add kotlin](native-add-kotlin.html) | Generates and adds a Kotlin file containing a class of the given name.
<% } %>
34 changes: 34 additions & 0 deletions docs/man_pages/project/configuration/native/native-add-kotlin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<% if (isJekyll) { %>---
title: ns native add kotlin
position: 3
---<% } %>

# ns native add kotlin

### Description

Adds a newly generated Kotlin file, which includes a class with the specified name, placing it in the appropriate directory.

Kotlin usage requires that the `useKotlin` property is set in `gradle.properties`, the command will set this to `true`.

### Commands

Usage | Synopsis
------|-------
Kotlin | `$ ns native add kotlin <Kotlin class name>`

### Arguments

* `<Kotlin class name>` is the fully qualified name of the `Class` to create, e.g. `org.nativescript.SomeClass`

<% if(isHtml) { %>

### Related Commands

Command | Description
----------|----------
[native add swift](native-add-swift.html) | Generates and adds a Swift file containing a class of the given name.
[native add objective-c](native-add-objective-c.html) | Generates and adds Objective-C files containing an interface of the given name.
[native add java](native-add-java.html) | Generates and adds a Java file containing a class of the given name.
[native add kotlin](native-add-kotlin.html) | Generates and adds a Kotlin file containing a class of the given name.
<% } %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<% if (isJekyll) { %>---
title: ns native add objective-c
position: 4
---<% } %>

# ns native add objective-c

### Description

Adds newly generated Objective-C files, which include an interface with the specified name, placing them in the appropriate directory.

Objective-C usage requires that the `module.modulemap` is modified to include the header file, the command will set this entry.

### Commands

Usage | Synopsis
------|-------
Objective-C | `$ ns native add objective-c <Objective-C interface name>`

### Arguments

* `<Objective-C interface name>` is the name of the `interface` to create, e.g. `SomeInterface`

<% if(isHtml) { %>

### Related Commands

Command | Description
----------|----------
[native add swift](native-add-swift.html) | Generates and adds a Swift file containing a class of the given name.
[native add objective-c](native-add-objective-c.html) | Generates and adds Objective-C files containing an interface of the given name.
[native add java](native-add-java.html) | Generates and adds a Java file containing a class of the given name.
[native add kotlin](native-add-kotlin.html) | Generates and adds a Kotlin file containing a class of the given name.
<% } %>
32 changes: 32 additions & 0 deletions docs/man_pages/project/configuration/native/native-add-swift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<% if (isJekyll) { %>---
title: ns native add swift
position: 5
---<% } %>

# ns native add swift

### Description

Adds a newly generated Swift file, which includes a class with the specified name, placing it in the appropriate directory.

### Commands

Usage | Synopsis
------|-------
Swift | `$ ns native add swift <Swift class name>`

### Arguments

* `<Swift class name>` is the name of the `Class` to create, e.g. `SomeClass`

<% if(isHtml) { %>

### Related Commands

Command | Description
----------|----------
[native add swift](native-add-swift.html) | Generates and adds a Swift file containing a class of the given name.
[native add objective-c](native-add-objective-c.html) | Generates and adds Objective-C files containing an interface of the given name.
[native add java](native-add-java.html) | Generates and adds a Java file containing a class of the given name.
[native add kotlin](native-add-kotlin.html) | Generates and adds a Kotlin file containing a class of the given name.
<% } %>
31 changes: 31 additions & 0 deletions docs/man_pages/project/configuration/native/native-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<% if (isJekyll) { %>---
title: ns native add
position: 1
---<% } %>

# ns native add

### Description

Commands to add native files to the application placing them in the correct directory.

### Commands

Usage | Synopsis
------|-------
Swift | `$ ns native add swift <Swift class name>`
Objective-C | `$ ns native add objective-c <Objective-C interface name>`
Java | `$ ns native add java <Java class name>`
Kotlin | `$ ns native add kotlin <Kotlin class name>`

<% if(isHtml) { %>

### Related Commands

Command | Description
----------|----------
[native add swift](native-add-swift.html) | Generates and adds a Swift file containing a class of the given name.
[native add objective-c](native-add-objective-c.html) | Generates and adds Objective-C files containing an interface of the given name.
[native add java](native-add-java.html) | Generates and adds a Java file containing a class of the given name.
[native add kotlin](native-add-kotlin.html) | Generates and adds a Kotlin file containing a class of the given name.
<% } %>
31 changes: 31 additions & 0 deletions docs/man_pages/project/configuration/native/native.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<% if (isJekyll) { %>---
title: ns native
position: 1
---<% } %>

# ns native

### Description

Commands to add native files to the application placing them in the correct directory.

### Commands

Usage | Synopsis
------|-------
Swift | `$ ns native add swift <Swift class name>`
Objective-C | `$ ns native add objective-c <Objective-C interface name>`
Java | `$ ns native add java <Java class name>`
Kotlin | `$ ns native add kotlin <Kotlin class name>`

<% if(isHtml) { %>

### Related Commands

Command | Description
----------|----------
[native add swift](native-add-swift.html) | Generates and adds a Swift file containing a class of the given name.
[native add objective-c](native-add-objective-c.html) | Generates and adds Objective-C files containing an interface of the given name.
[native add java](native-add-java.html) | Generates and adds a Java file containing a class of the given name.
[native add kotlin](native-add-kotlin.html) | Generates and adds a Kotlin file containing a class of the given name.
<% } %>
11 changes: 10 additions & 1 deletion lib/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,5 +458,14 @@ injector.require("keyCommandHelper", "./helpers/key-command-helper");

injector.requireCommand("start", "./commands/start");
injector.require("startService", "./services/start-service");

injector.requireCommand(
[
"native|add",
"native|add|java",
"native|add|kotlin",
"native|add|swift",
"native|add|objective-c",
],
"./commands/native-add"
);
require("./key-commands/bootstrap");
Loading

0 comments on commit 2f2d1e0

Please sign in to comment.