CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-react-native-community--cli-platform-android

Android platform commands for React Native CLI providing run-android, build-android, and log-android commands for managing Android development workflow

Pending
Overview
Eval results
Files

project-configuration.mddocs/

Project Configuration

Android project configuration utilities for React Native CLI, providing project detection, dependency management, and build configuration. These functions are re-exported from @react-native-community/cli-config-android.

Capabilities

Project Configuration

Core Android project configuration for React Native CLI integration.

/**
 * Android project configuration function
 * Returns configuration object for Android project detection and setup
 * @returns Android project configuration object
 */
function projectConfig(): any;

Usage Examples:

import { projectConfig } from "@react-native-community/cli-platform-android";

// Get Android project configuration
const config = projectConfig();
console.log("Android project config:", config);

Dependency Configuration

Configuration for Android dependencies and native modules.

/**
 * Android dependency configuration function
 * Returns configuration for managing Android dependencies and native modules
 * @returns Android dependency configuration object
 */
function dependencyConfig(): any;

Usage Examples:

import { dependencyConfig } from "@react-native-community/cli-platform-android";

// Get dependency configuration
const depConfig = dependencyConfig();
console.log("Android dependency config:", depConfig);

Android Project Detection

Utilities for detecting and retrieving Android project information.

/**
 * Get Android project configuration object
 * Detects and returns Android project configuration from the current directory
 * @returns Android project configuration object or null if not found
 */
function getAndroidProject(): any;

/**
 * Extract Android package name from project
 * Reads the package name from Android project configuration
 * @returns Android package name string
 */
function getPackageName(): string;

Usage Examples:

import { getAndroidProject, getPackageName } from "@react-native-community/cli-platform-android";

// Get Android project configuration
const androidProject = getAndroidProject();
if (androidProject) {
  console.log("Android project found:", androidProject);
  
  // Get package name
  const packageName = getPackageName();
  console.log("Package name:", packageName);
}

Language Detection

Utilities for detecting the programming language used in Android projects.

/**
 * Check if Android project uses Kotlin
 * Analyzes project files to determine if Kotlin is being used
 * @returns true if project uses Kotlin, false if Java
 */
function isProjectUsingKotlin(): boolean;

Usage Examples:

import { isProjectUsingKotlin } from "@react-native-community/cli-platform-android";

// Check project language
const usesKotlin = isProjectUsingKotlin();
if (usesKotlin) {
  console.log("Project uses Kotlin");
} else {
  console.log("Project uses Java");
}

Configuration Integration

React Native CLI Integration

These configuration functions are primarily used internally by React Native CLI for:

  • Project Discovery: Automatically detecting Android projects in monorepos or standard React Native projects
  • Build Configuration: Setting up proper build paths and parameters for Gradle builds
  • Dependency Management: Managing native module dependencies and linking
  • Platform Detection: Identifying Android-specific configuration requirements

Configuration Object Structure

While the exact structure depends on the underlying cli-config-android implementation, typical configuration objects include:

  • Source Directory: Path to Android source code
  • Build Directory: Path to build outputs
  • Application Name: Android app name
  • Package Name: Android package identifier
  • Gradle Configuration: Build tool settings
  • Manifest Location: AndroidManifest.xml path
  • Resources Directory: Android resources path

Usage in Commands

These configuration functions are automatically used by the CLI commands:

// Internal usage in run-android command
const androidProject = getAndroidProject();
const packageName = getPackageName();
const isKotlin = isProjectUsingKotlin();

// Use configuration for build and run operations
if (androidProject) {
  // Proceed with Android-specific operations
}

Important Notes

  • These functions are re-exported from @react-native-community/cli-config-android
  • They provide a stable interface for Android project configuration
  • Return types may vary based on project structure and cli-config-android version
  • Functions may return null or undefined if Android project is not detected
  • Used internally by CLI commands but can be accessed directly for custom tooling

Install with Tessl CLI

npx tessl i tessl/npm-react-native-community--cli-platform-android

docs

build-system.md

commands.md

device-management.md

emulator-management.md

index.md

network-configuration.md

project-configuration.md

tile.json