Gaelic Ireland (Irish: Eire Ghaidhealach) was the Gaelic political and social order, and associated culture, that existed in Ireland from the prehistoric era until the early 17th century. Before the Norman invasion of 1169, Gaelic Ireland comprised the whole island. Thereafter, it comprised that part of the country not under foreign dominion at a given time. For most of its history, Gaelic Ireland was a "patchwork" hierarchy of territories ruled by a hierarchy of kings or chiefs, who were elected through tanistry.

For most of the Gaelic period, dwellings and farm buildings were circular with conical thatched roofs (see roundhouse). Square and rectangle-shaped buildings gradually became more common, and by the 14th or 15th century they had replaced round buildings completely. In some areas, buildings were made mostly of stone. In others, they were built of timber, wattle and daub, or a mix of materials. Most ancient and early medieval stone buildings were of dry stone construction. Some buildings would have had glass windows. Among the wealthy, it was common for women to have their own 'apartment' called a grianan (anglicized "greenan") in the sunniest part of the homestead.  The dwellings of freemen and their families were often surrounded by a circular rampart called a "ringfort". There are two main kinds of ringfort. The rath is an earthen ringfort, averaging 30m diameter, with a dry outside ditch. The cathair or caiseal is a stone ringfort. The ringfort would typically have enclosed the family home, small farm buildings or workshops, and animal pens. Most date to the period 500-1000 CE and there is evidence of large-scale ringfort desertion at the end of the first millennium. The remains of between 30,000 and 40,000 lasted into the 19th century to be mapped by Ordnance Survey Ireland. Another kind of native dwelling was the crannog, which were roundhouses built on artificial islands in lakes.  There were very few nucleated settlements in Gaelic areas. However, after the 5th century some monasteries became the heart of small "monastic towns". By the 10th century the Norse-Gaelic ports of Dublin, Wexford, Cork and Limerick had grown into substantial settlements. It was at this time, perhaps as a response to Viking raids, that many of the Irish round towers were built.  In the fifty years before the Norman invasion, the term "castle" (Old Irish: caistel/caislen) appears in Gaelic writings, although there are no surviving examples of pre-Norman castles. After the invasion, the Normans built motte-and-bailey castles in the areas they occupied, some of which were converted from ringforts. By 1300 "some mottes, especially in frontier areas, had almost certainly been built by the Gaelic Irish in imitation". The Normans gradually replaced wooden motte-and-baileys with stone castles and tower houses. Tower houses are free-standing multi-storey stone towers usually surrounded by a wall (see bawn) and ancillary buildings. Gaelic families had begun to build their own tower houses by the 15th century. As many as 7000 may have been built, but they were rare in areas with little Norman settlement or contact. They are concentrated in counties Limerick and Clare but are lacking in Ulster, except the area around Strangford Lough.  In Gaelic law, a 'sanctuary' called a maighin digona surrounded each person's dwelling. The maighin digona's size varied according to the owner's rank. In the case of a boaire it stretched as far as he, while sitting at his house, could cast a cnairsech (variously described as a spear or sledgehammer). The owner of a maighin digona could offer its protection to someone fleeing from pursuers, who would then have to bring that person to justice by lawful means.Answer this question using a quote from the following article:

What did they replaced the round buildings with ?
Square and rectangle-shaped buildings