Skip to content

SM8250-Common/build-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Custom ROM Build Script

Automated Custom ROM build script with Telegram notifications, GoFile upload.

Requirements

pip3 install requests
  • Python 3.8+
  • repo, git

Usage

./build.py <device> [options]

<device> can be a codename (looks up devices/<codename>.json) or a direct path to a device JSON file.

Options

Flag Description
--source NAME_OR_PATH Source name from sources/<name>.json or path to a source JSON file (default: pixelos)
--skip-sync Skip source sync
--skip-clone Skip device repo cloning
--skip-upload Skip GoFile upload
--clean-repos Clean device repos before cloning
--build-dir PATH Custom build directory (default: ~/<source name>)

Examples

# Full build using default source config (sources/pixelos.json)
./build.py spartan

# Build with explicit source config name
./build.py spartan --source pixelos

# Build with custom source config file
./build.py spartan --source ./sources/custom.json

# Incremental build (skip sync + clone)
./build.py spartan --skip-sync --skip-clone

# Build without upload
./build.py spartan --skip-upload

Device Configuration

Add device configs to devices/<codename>.json. See devices/device-template.json for the full template.

{
  "device": {
    "codename": "spartan",
    "full_name": "Realme GT Neo 3T"
  },
  "environment": {
    "EXCLUDE_RECOVERY": "true"
  },
  "repositories": {
    "device_tree": {
      "url": "https://github.com/...",
      "branch": "lineage-23.0",
      "path": "device/realme/spartan"
    },
    "vendor_tree": {
      "url": "https://github.com/...",
      "branch": "lineage-23.0",
      "path": "vendor/realme/spartan"
    }
  }
}

Source Configuration

Source configs live in sources/. Use sources/rom-template.json as a starting point.

{
  "name": "LineageOS",
  "manifest": {
    "url": "https://github.com/LineageOS/android.git",
    "branch": "lineage-23.2"
  },
  "sync_jobs": 8,
  "build": {
    "envsetup": "build/envsetup.sh"
  },
  "output": {
    "pattern": "*Lineage*.zip"
  }
}

Telegram Notifications

Option 1: Set environment variables

export TELEGRAM_BOT_TOKEN="your-bot-token"
export TELEGRAM_CHAT_ID="your-chat-id"

Option 2: Interactive prompt (script asks if vars are missing)

Disable: export TELEGRAM_DISABLE=true

Environment Cleanup

The script automatically cleans all stale AOSP build variables (TARGET_PRODUCT, LUNCH_MENU_CHOICES, ANDROID_BUILD_TOP, etc.) before each build run, ensuring no state leaks from previous builds.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages