Skip to content

Instantly share code, notes, and snippets.

View pepicrft's full-sized avatar
🌱
Open-sourcing

Pedro Piñera Buendía pepicrft

🌱
Open-sourcing
View GitHub Profile

Commands like tuist build and tuist generate support passing arguments that represent the targets a developer wants to focus on. While the target level of granularity gives developers a lot of control, it puts them in a position of having to script around Tuist to be able to pass a group of tagets that have a semantic meaning. Here are some scenarios:

  • I'd like to focus on all the targets of a project
  • I'd like to focus only on the external targets
  • I'd like to focus only on the test targets
  • I'd like to focus only on the targets with a given tag

This has come up several times, so I'm taking the time to write down how I'd approach it if I was about to implement it as a first time contributor.

First of all, make sure you've read the Get started guidelines for contributors. At the end of it, you should be able to run tuist through the scheme in the Xcode project. Once you are familiar with that, I recommend loooking at the [generate command](ht

@pepicrft
pepicrft / tuist.svg
Created June 28, 2023 14:08
Tuist Logo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
(function() {
"use strict";
function toCamelCase(str) {
return str.toLowerCase().replace(/-+(.)/g, (s, char) => char.toUpperCase());
@pepicrft
pepicrft / check_empty_build_settings.rb
Created January 3, 2020 16:39
A Ruby code snippet to check whether an Xcode project and its targets have empty build settings
require 'xcodeproj'
desc "Errors if the project contains build settings"
task :check_empty_build_settings do
project = Xcodeproj::Project.open(PROJECT_PATH)
elements_with_settings = []
# Project
project
.build_configurations
import ProjectDescription
let project = Project(name: "HelloWorld",
schemes: [
/* Project schemes are defined here */
Scheme(name: "HelloWorld",
shared: true,
buildAction: BuildAction(targets: ["HelloWorld"])),
],
settings: Settings(base: [:],
import ProjectDescription
let project = Project(name: "website",
schemes: [
/* Project schemes are defined here */
Scheme(name: "website",
shared: true,
buildAction: BuildAction(targets: ["website"])),
],
settings: Settings(base: [:],
let branch = "release/1.0.0"
try utils.git.createBranch(branch)
try utils.shell.runAndPrint(bash: "swift build")
try utils.git.addAll()
try utils.git.commitAll(message: "[\(branch)] Bump version")
try utils.git.tag(version)
try utils.git.push(remote: "origin", branch: branch, tags: true)
// Sakefile
Sake<Task> {
$0.beforeEach {
// Do something
}
$0.afterAll {
// Do something
}
}.run()
sake tasks
sake task name