# Package com.codename1.annotations.buildhints

package com.codename1.annotations.buildhints

Build hints expressed as annotations, so the compiler checks them.

A build hint used to be a `codename1.arg.<name>=<value>` line in `codenameone_settings.properties`. Nothing validated it, so a misspelled name was copied into the build request, never read, and silently dropped: the build stayed green and the setting simply did nothing. Written as an annotation the same mistake is an unknown symbol, a wrong value type is a type error, and a value outside a hint's supported set is an unknown enum constant.

Put the annotations on your application's main class:

    @Ios(newStorageLocation = true, themeMode = IosThemeMode.MODERN)
    @Android(themeMode = AndroidThemeMode.MODERN)
    @Desktop(titleBar = DesktopTitleBar.NATIVE)
    public class MyApplication {
    }

These annotations cover the hints most applications set. The rest, and the open-ended families such as `android.permission.<NAME>` that an annotation cannot express, are still set in `codenameone_settings.properties`, which continues to work exactly as before. Setting the same hint in both places is a build error.

A project generated recently already runs the goal that turns these into build hints. An older one may not: a goal's default phase does not add an execution to a project, so the annotations would compile and then be ignored. The build refuses rather than shipping without them, and the module that compiles the main class needs:

    <execution>
      <id>cn1-process-classes</id>
      <phase>process-classes</phase>
      <goals>
        <goal>process-annotations</goal>
      </goals>
    </execution>

Generated from com.codename1.build.shared.BuildHints by BuildHintCodeGenerator. Do not edit by hand -- edit the catalog and re-run scripts/gen-build-hint-annotations.sh.

- Related Packages
  Package
  Description
  com.codename1.annotations
  Codename One specific Java annotations used by the build pipeline and the ParparVM bytecode translator to mark methods and classes for special treatment -- e.g.
  com.codename1.annotations.graphql
  Annotations for declaring type safe GraphQL clients.
  com.codename1.annotations.grpc
  gRPC-Web client annotations.
  com.codename1.annotations.rest
  Annotations for declaring type safe REST clients.
- Class
  Description
  Android
  Android build hints, checked by the compiler.
  AndroidThemeMode
  Accepted values of the `and.themeMode` build hint.
  Build
  Build hints that are not specific to one platform.
  Desktop
  Desktop build hints, checked by the compiler.
  DesktopTitleBar
  Accepted values of the `desktop.titleBar` build hint.
  HardenControlFlow
  Accepted values of the `harden.controlFlow` build hint.
  Hardening
  App hardening build hints, checked by the compiler.
  HardenLevel
  Accepted values of the `harden.level` build hint.
  HardenStrings
  Accepted values of the `harden.strings` build hint.
  InstallLocation
  Accepted values of the `android.installLocation` build hint.
  Ios
  iOS build hints, checked by the compiler.
  IosDependencyManager
  Accepted values of the `ios.dependencyManager` build hint.
  IosPrivacy
  iOS `Info.plist` privacy usage descriptions.
  IosProjectType
  Accepted values of the `ios.project_type` build hint.
  IosThemeMode
  Accepted values of the `ios.themeMode` build hint.
  NativeThemeMode
  Accepted values of the `nativeTheme` build hint.
  OnDeviceDebug
  On-device debugging build hints for iOS and Android.