fingerprint method

  1. @override
Future<NativeStepFingerprint> fingerprint(
  1. NativeStepContext context
)
override

Compute a fingerprint for this step based on its inputs.

Used for build caching to determine if a step needs to be re-executed.

Implementation

@override
Future<NativeStepFingerprint> fingerprint(NativeStepContext context) async {
  final buffer = StringBuffer();
  buffer.write('git_checkout');
  buffer.write(
    expandRecipeValue(repository, context.buildContext, context.source),
  );
  buffer.write(
    expandRecipeValue(revision, context.buildContext, context.source),
  );
  buffer.write(submodules);
  if (targetDirectory != null) {
    buffer.write(
      expandRecipeValue(
        targetDirectory!,
        context.buildContext,
        context.source,
      ),
    );
  }
  return NativeStepFingerprint(
    id: id,
    hash: fingerprintHash(buffer.toString()),
  );
}