Skip to content

Commit

Permalink
WIP: Cordova Android integration
Browse files Browse the repository at this point in the history
  • Loading branch information
breautek committed Mar 4, 2025
1 parent 040d05d commit ddc1cae
Show file tree
Hide file tree
Showing 17 changed files with 869 additions and 0 deletions.
1 change: 1 addition & 0 deletions cordova/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/lib
2 changes: 2 additions & 0 deletions cordova/android/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/src
/tsconfig.json
265 changes: 265 additions & 0 deletions cordova/android/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions cordova/android/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@btfuse/cordova-android",
"version": "0.0.0",
"description": "Fuse Android platform for the Cordova Runtime",
"main": "lib/api.js",
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "[email protected]",
"license": "Apache-2.0",
"devDependencies": {
"@types/elementtree": "^0.1.5",
"@types/node": "^22.10.7",
"ts-node": "^10.9.2",
"typescript": "^5.7.3"
},
"dependencies": {
"elementtree": "^0.1.7"
}
}
81 changes: 81 additions & 0 deletions cordova/android/src/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

import {
ConfigParser,
CordovaEventEmitter,
ICreatePlatformOptions
} from '../../types/cordova';

const VERSION: string = '0.0.0';

export = class API {
public platform: string;
public root: string;

public constructor(platform: unknown, platformRootDir: string, events: unknown) {
this.platform = 'fuse-android';
this.root = platformRootDir;
}

public getPlatformInfo(): unknown {
return {
locations: null,
root: this.root,
name: this.platform,
version: VERSION,
projectConfig: null
};
}

public async prepare(project: unknown, options: unknown): Promise<unknown> {
console.log('PREPARE', project, options);
return;
}

public async addPlugin(plugin: unknown, options: unknown): Promise<unknown> {
console.log('ADD PLUGIN', plugin, options);
return;
}

public async removePlugin(plugin: unknown, options: unknown): Promise<unknown> {
console.log('REMOVE PLUGIN', plugin, options);
return;
}

public async build(options: unknown): Promise<unknown> {
console.log('BUILD', options);
return;
}

public async run(options: unknown): Promise<unknown> {
console.log('RUN', options);
return;
}

public async listTargets(options: unknown): Promise<unknown> {
console.log('LIST TARGETS', options);
return;
}

public async clean(options: unknown): Promise<unknown> {
console.log('CLEAN', options);
return;
}

public async requirements(): Promise<unknown> {
console.log('REQUIREMENTS');
return;
}

public static async createPlatform(destination: string, config: ConfigParser, options: ICreatePlatformOptions, events: CordovaEventEmitter): Promise<API> {
console.log('CREATE PLATFORM', destination, config, options, events);
return new API(null, destination, events);
}

public static updatePlatform(destination: string, options: unknown, events: unknown): API {
return new API(null, destination, events);
}

public static version(): string {
return VERSION;
}
}
Loading

0 comments on commit ddc1cae

Please sign in to comment.