Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jcassidyav/nativescript-native-add

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jcassidyav/nativescript-native-add - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

18

commands/native-add.js

@@ -52,2 +52,11 @@ "use strict";

}
getAndroidSourcePathBase(projectData) {
if (this.isPlugin(projectData)) {
return path.join("platforms", "android", "java");
}
else {
const resources = this.$projectData.getAppResourcesDirectoryPath();
return path.join(resources, 'Android', 'src', 'main', 'java');
}
}
}

@@ -111,10 +120,6 @@ exports.NativeAddCommand = NativeAddCommand;

doJavaKotlin(className, extension) {
if (extension == 'kotlin' && !this.checkAndUpdateGradleProperties()) {
return;
}
const resources = this.$projectData.getAppResourcesDirectoryPath();
const fileExt = extension == 'java' ? extension : 'kt';
const packageName = this.getPackageName(className);
const classSimpleName = this.getClassSimpleName(className);
const packagePath = path.join(resources, 'Android', 'src', 'main', 'java', ...packageName.split('.'));
const packagePath = path.join(this.getAndroidSourcePathBase(this.$projectData), ...packageName.split('.'));
const filePath = path.join(packagePath, `${classSimpleName}.${fileExt}`);

@@ -125,2 +130,5 @@ if (fs.existsSync(filePath)) {

}
if (extension == 'kotlin' && !this.isPlugin(this.$projectData) && !this.checkAndUpdateGradleProperties()) {
return;
}
const fileContent = extension == 'java' ? this.generateJavaClassContent(packageName, classSimpleName) : this.generateKotlinClassContent(packageName, classSimpleName);

@@ -127,0 +135,0 @@ fs.mkdirSync(packagePath, { recursive: true });

{
"name": "@jcassidyav/nativescript-native-add",
"preferGlobal": true,
"version": "0.0.4",
"version": "0.0.5",
"author": "jcassidyav",

@@ -25,3 +25,3 @@ "description": "Extension to allow adding of some native files in a Nativescript Project",

"devDependencies": {
"nativescript": "^8.5.3"
"nativescript": "^8.6.5"
},

@@ -28,0 +28,0 @@ "analyze": true,

@@ -9,1 +9,9 @@ # nativescript-native-add

Installs to `~/.local/share/.nativescript-cli/extensions`
## Provided commands
```shell
ns native add swift SomeClass
ns native add objective-c SomeOtherClass
ns native add java some.thing.SomeClass
ns native add kotlin some.thing.SomeOtherClass
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc