Giter VIP home page Giter VIP logo

admgen's Introduction

Go code generators for the Apple Device Management schema data

Package admgen and its related commands generate Go code from the Apple Device Management schema data.

Go Reference

Example

For example assuming you had the Apple repository checked out in ./device-management of this repo, you could:

$ go run ./cmd/admgencmd/... ./device-management/mdm/commands/information.device.yaml | head
// Code generated by "admgencmd"; DO NOT EDIT.
// Source: information.device.yaml
package main

import "time"

// GenericCommandPayload is the "inner" generic payload for Apple MDM commands.
type GenericCommandPayload struct {
	RequestType                  string // must be set to MDM command name
	RequestRequiresNetworkTether *bool  `plist:",omitempty"`

admgen's People

Contributors

jessepeterson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

admgen's Issues

Investigate commands that don't parse/generate correctly

Just haven't had time yet, but it appears these just fall on their face:

$ grep \# gengen.py 
#!/usr/bin/env python3
        # "information.contentcaching.yaml", # parse/gen problems
    # "settings": ["settings.yaml"], # parse/gen problems, dup structs
        # "device.restrictions.list.yaml", # parse/gen problems
        # "application.extensions.listactive.yaml", # dup structs
        # "application.managed.list.yaml", # parse/gen problems
        # "managed.application.attributes.yaml", # parse/gen problems
        # "managed.application.configuration.yaml", # parse/gen problems
        # "managed.application.feedback.yaml", # parse/gen problems

These are from the gengen.py script here

Handle duplicate namespace (struct) names

Some commands like DeviceInformation and Settings have duplicate defined structures in the schema (e.g. OrganizationInfo. These can clash and cause compile failures.

An earlier version of the code generator prefixed all structures with a shortened version of the command name. For example "DI" would prefix all "DeviceInformation" structures. So this would be DIOrganizationInfo and SOrganizationInfo. You could prefix the whole command name, of course, but then we start getting really long names.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.